WordPress.org

Support

Support » How-To and Troubleshooting » not all posts in child categories showing up

not all posts in child categories showing up

  • Hi All:

    I was hoping someone out there in WP-genius land could shed some light on what I am doing wrong here. My “Blog” posts all exist under the parent category “Blog Posts” (although I have other parent categories that serving different purposes). I have created a page template with a custom query that calls my posts and paginates the results just fine if I am grabbing “all” posts in all categories (which I do not want to do). Ideally I would like to display all posts in the parent (Blog Posts) and all it’s children but when I use the following I only get the first 3 posts (even though I know I have lots more):

    `<?php
    $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
    $args=array(
    ‘paged’ => $paged,
    ‘category_name’ => ‘Blog Posts’,
    ‘posts_per_page’ => 5,
    );
    $temp = $wp_query;
    $wp_query = null;
    $wp_query = new wp_query();
    $wp_query->query($args);
    ?>
    <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>`

    Any feedback would be greatly appreciated. Thanks in advance for looking!

    Eric

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘not all posts in child categories showing up’ is closed to new replies.