limiting number of posts
-
I have 2 versions of the same site set up on different servers (dev and live). I need to limit the number of posts on the sites to 6 – I’ve tried 3 different techniques that all work on dev, but not on live. The ‘Reading’ number of posts is set to 10 on both sites but the live one always shows 11 posts.
Here are the 3 code snippets that I’ve used (that do work on dev but not live)
1.
<?php $page_num = $paged; if ($pagenum='') $pagenum =21; query_posts('showposts=7&paged='.$page_num); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="home-short-post"><a href="< ?php the_permalink() ?>" rel="bookmark"><div class="heading4">< ?php the_title(); ?></div>< ?php the_excerpt(); ?></a></div> < ?php endwhile;endif; ?>
2.
`<?php
query_posts( ‘posts_per_page=5’ );
while ( have_posts() ) : the_post();?>
<div class=”home-short-post”><a href=”<?php the_permalink() ?>” rel=”bookmark”><div class=”heading4″><?php the_title(); ?></div><?php the_excerpt(); ?></a></div>
<?php endwhile; ?>`3.
`<?php $recent = new WP_Query(“showposts=12”); while($recent->have_posts()) : $recent->the_post();?>
<div class=”home-short-post”><a href=”<?php the_permalink() ?>” rel=”bookmark”><div class=”heading4″>< ?php the_title(); ?></div><?php the_excerpt(); ?></a></div>
<?php endwhile;?>`I assume that something else must be the issue, but I have no idea what setting might be effecting it. Any thoughts?
- The topic ‘limiting number of posts’ is closed to new replies.