最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

terms - Taxonomy.php inheriting first post

programmeradmin2浏览0评论

I created a generic taxonomy.php file to list posts with certain terms.

<?php get_header(); ?>

<?php 
if ( have_posts() ) : 
    while ( have_posts() ) : the_post(); ?>
        <a href="<?php echo get_permalink(); ?>"><h1><?php echo get_the_title(); ?></h1></a>
    <?php endwhile; 
endif; 
?>

<?php get_footer(); ?>

The page works fine but it looks like it's inheriting terms and other things from the first post of the list in the loop... it even has the post ID of that said post.

How do I prevent this from happening? I have conditions within my enqueue.php that loads different styles for this particular post which I don't want.

发布评论

评论列表(0)

  1. 暂无评论