The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

[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

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

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

    < ?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:
    the "the daily dose" link, is my main blog page.

    # October 28, 2009 at 6:12 pm

    found it:


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


    < ?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.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed