I’ve got custom archive page (code below) setup on my site. The problem is, for some reason, it only shows 5 posts per category (which you can see under the "Front Axle" category). All 6 posts show up and when I remove one of the posts that are displayed from that category, the missing post shows up.
I just don’t see anything in here that would be limiting the number of posts returned. Anybody know what the deal is?
Thanks!
<?php get_header(); ?> <div id="content"> <?php if (have_posts()) : ?> <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?> <div class="entry"> <?php /* If this is a category archive */ if (is_category()) { ?> <h2>Posts in the ‘<?php single_cat_title(); ?>’ Category</h2> <small>(reverse chronological order)</small> <?php /* If this is a daily archive */ } elseif (is_day()) { ?> <h2>Posts in <?php the_time('F jS, Y'); ?></h2> <small>(reverse chronological order)</small> <?php /* If this is a monthly archive */ } elseif (is_month()) { ?> <h2>Posts in <?php the_time('F, Y'); ?></h2> <small>(reverse chronological order)</small> <?php /* If this is a yearly archive */ } elseif (is_year()) { ?> <h2>Posts in <?php the_time('Y'); ?></h2> <small>(reverse chronological order)</small> <?php /* If this is an author archive */ } elseif (is_author()) { ?> <h2>Author Archive</h2> <small>(reverse chronological order)</small> <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?> <h2>Blog Archives</h2> <small>(reverse chronological order)</small> <?php } ?> </div> <div class="entry"> <div class="post"> <?php $cats = get_categories("child_of=4"); ?> <?php if($cats != NULL) { ?> <ul> <?php foreach ($cats as $cat) { ?> <li> <?php if($cat != NULL) { $base_url = get_bloginfo('home') . "/?cat=" . $cat->cat_ID; ?> <p /><h3><a href="<?php echo $base_url?>"><?php echo $cat->cat_name?></a></h3> <?php } ?> <?php $myposts = get_posts("category=$cat->cat_ID"); ?> <ul> <?php foreach($myposts as $post) : ?> <li><?php the_time('M d') ?>. <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul> </li> <?php } ?> </ul> <?php } ?> </div> </div> <?php else : ?> <div class="entry"> <h2 class="center">Not Found</h2> <div class="entry"> <?php endif; ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
number of posts defaults to 5 in get_posts() function, change to something like this:
<?php $myposts = get_posts("category=$cat->cat_ID&numberposts=10"); ?>
more info here
number of posts defaults to 5 in get_posts() function, change to something like this:
<?php $myposts = get_posts("category=$cat->cat_ID&numberposts=10"); ?> more info here |
You rock.
I appreciate it!
Billy