WordPress.org

Ready to get started?Download WordPress

Forums

if (is_cat) is not filtering properly (2 posts)

  1. demonboy
    Member
    Posted 2 years ago #

    I am using twentyeleven as a basis for my customised theme. In the category.php file I have included

    <?php
      $post = $wp_query->post;
    
      if (in_category('3')) {
          include(TEMPLATEPATH.'/blog.php');
      }
    ?>

    However all this does is use the blog.php template for my blog category, but then repeats the blog entry using the normal category.php code. I have tried including an else statement to say just use category.php, and I've tried filtering out category 3 by adding a query_post, but this doesn't make any difference. Any ideas why I am getting two entries in my blog category?

    The full code for my blog.php file is:

    [code moderated - please use the http://pastebin.com/ for any code longer than 10 lines - see http://codex.wordpress.org/Forum_Welcome#Posting_Code ]

    And the full code for my category.php file is:

    [dito]

  2. demonboy
    Member
    Posted 2 years ago #

    OK, apologies.

    So the blog.php content is here and the category.php is here.

    Can anyone help?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags