Support » Fixing WordPress » Child post showing up in parent category

  • I finally pulled the trigger on switching my static site to WP and started trying to recreate some of my pages, I’m using Brian Gardner’s free Revolution blog theme but attempting to make a few hacks to suit my site such as one category, News, appears on the Home page. I’ve created a category called Kids and a subcat called Kellie and placed a test post in each, however the post in the subcat Kellie is also appearing on the Kids category page. I’ve searched through the template tags and used every combination of in_category and query_posts to display only the Kids posts on that page or exclude the Kellie posts from that page I could think of. I’m not certain if these particular tags are the right way to produce my results or if I’m putting them in the wrong place. My last resort is to remove the Kids category all together and make a Kids Page, and a page and category for each kid, and then query_posts on the appropriate kid category on their Page and hide all categories and subcats.

    My end goal was to have no categories showing up in the right nav and both categories and pages would appear in the top nav with dropdowns to the sub cats/pages. Only the Kids (and the subcats for each kid) and News categories would actually have blogs while the rest of the site would be static pages.

    Which way seems the “most logical”?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Also, if I make a page and query posts to that page, will it still use my global settings for how many per page and what happens when it gets more than that setting, does it make a new Page for older?

    This worked for me, including only category & excluding child:

    <?php if (is_category('slug-for-category')) { ?>
    <?php $posts = query_posts("&cat=8,-25&orderby=post_date&order=asc&posts_per_page=30&paged=$page"); ?>
    <?php } else { ?>
    <?php $posts = query_posts($query_string.'&orderby=post_date&order=asc&posts_per_page=30&paged=$page'); ?>
    <?php } ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Child post showing up in parent category’ is closed to new replies.