• Resolved abietto

    (@abietto)


    Hi, I have a really strange problem. On my website (www.abietto.net/wordpress/) I have made a category template that calls all the “movie reviews”, a subcategory of the main “review” category, ID number 27. I made many pages in this category (with a plugin) that I want to translate as normal posts and before that I made a couple of post just to test things out. Problem is: in the main list of all the post in that subcategory (http://www.abietto.net/wordpress/category/recensioni/recensioni-film/) these posts are correctly listed (and that means WP recognize them correctly as assigned to category 27) but if I click on them and I go to the “single post” page of that posts, it’s like WP suddendly doesn’t know anymore which category they are (for example the post http://www.abietto.net/wordpress/2008/03/23/prova-recensioni-film/ or http://www.abietto.net/wordpress/2008/03/23/prova-recensioni-film-2/). I made some conditional tags to present data differently with a “if (is_single())” but that doesn’t seem to work in any way. I tried many different ways and position of the conditional tag and loop but nothing seems to work. The actual code is like this:

    <?php get_header(); ?>
    <h1>THIS IS CATEGORY 27</h1>
    <?php if (have_posts()) : ?>
    <?php if (is_single()) : ?>
    <?php while (have_posts()) : the_post(); ?>
         Something to do if this is a single post page in that category (the file is category-27.php).
    <?php endwhile; ?>
    <?php else : ?>
    <?php while (have_posts()) : the_post(); ?>
         Something to do if it's not a single post page: the code I put here works perfectly!
    <?php endwhile; ?>
    <?php endif; ?>
    <?php else: ?>
         No posts found
    <?php endif; ?>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    For strange reasons, everything seems to work fine except in the single post page and I really can’t understand why… Can any of you help me out with this, please? =) Thanx in advance!

Viewing 1 replies (of 1 total)
  • Thread Starter abietto

    (@abietto)

    I was looking at the problem from the wrong side, it seems. Changing the single.php with the right conditional tags gave me the result I wanted.

Viewing 1 replies (of 1 total)
  • The topic ‘Subcategories and single post pages’ is closed to new replies.