OK, here’s my prob. I have static homepage and a separate posts page on my wordpress site. I have defined the two in the admin panel. Now, I have also set the max number of posts to be displayed to 5(in settings> reading), but all the posts(10+) are still being displayed on the blog page.

I’m also displaying the latest 3 posts on the static homepage using a custom query. i.e

$wp_query = new WP_Query( array( 'posts_per_page' =>3));

<results loop code>

But this list also is displaying more than 3 posts.It seems wordpress is ignoring the posts_per_page limit I set whether I do it at the admin panel or through code. What the hell is going on? This is my 1st time using wordpress for developing a site. Is this a common problem for noobs?

EDIT:

I just stripped the static homepage bare and left a basic code block that simply fetches titles of the posts. More than 3 posts are still being returned. Here is the actual(and only) code currently in the homepage:

<div id="content">

  <?php $wp_query = new WP_Query( array( 'posts_per_page' => 3) );?>

  <?php if ( $wp_query->have_posts() ) : ?>
  <ul>
    <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
    <li>
      <a href="https://wordpress.stackexchange.com/questions/39099/<?php the_permalink() ?>"><?php the_title(); ?></a>
    </li>
    <?php endwhile;?>
  </ul>
  <?php endif; ?>

</div>

4 Answers
4

This could be caused by a theme or plugin overriding the WordPress settings. You could try enabling the TwentyEleven or TwentyTen theme, as well as disabling any plugins, to see if it works then.

If so, you could post which theme you are using (if it’s prebuilt) or which plugins you had to disable to get it working – and we can see what can be done to remedy it.

Leave a Reply

Your email address will not be published. Required fields are marked *