Grow your CSS skills. Land your dream job.

[Solved] Limit Posts Shown Per Page (not Blog page)

  • # October 28, 2009 at 2:33 pm

    Hey everyone,
    So i’ve managed to get a "static" front page that displays 5 recent posts (it’s getting 5 from the number i’ve set in "readings settings". Well, I’d like to display only three on the front page if possible, while still keeping five on my main blog page.
    Any ideas?

    here’s the loop on the front page.
    changing the number in (‘show_posts=3′) makes no difference. however the

    Code:
    < ?php query_posts('show_posts=3'); ?>

    is the only thing that allows my posts to be shown at all, for some reason.

    Code:
    < ?php query_posts('show_posts=3'); ?>
    < ?php if (have_posts()) : ?>

    < ?php while (have_posts()) : the_post(); ?>

    id=”post-< ?php the_ID(); ?>“>

    < ?php the_excerpt(); ?>
    ” title=”Read the rest of < ?php the_title(); ?>” class=”more-link”>read more…

    < ?php endwhile; ?>

    • < ?php next_posts_link('« Older Entries') ?>
    • < ?php previous_posts_link('Newer Entries »') ?>

    < ?php else : ?>

    Not Found

    Sorry, but you are looking for something that isn’t here.

    < ?php get_search_form(); ?>

    < ?php endif; ?>

    any ideas would be appreciated, thanks!
    oh, and here’s the site:
    http://www.wasatchendocrinology.com
    the "the daily dose" link, is my main blog page.

    # October 28, 2009 at 6:12 pm

    found it:

    replace

    Code:
    < ?php query_posts('showposts=3'); ?>

    with

    Code:
    < ?php query_posts('posts_per_page=3'); ?>

    and done.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".