ThemeShaper Forums » Thematic


number of home page posts

(5 posts)
  • Started 9 years ago by craw
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. craw

    I tried the following code to reduce the number of posts on my home page- it worked but it also reduced the number of posts on the page I have turned the blog template on (basically the same function as "settings > reading"). Is there a way to tell the home page 1 post only?

    function single_post_on_homepage() { if(is_home()) { ?>

    <?php query_posts("showposts=1"); ?>

    <?php } }

    Posted 9 years ago #
  2. do you want to reduce the number of posts per page or reduce/limit the total number of posts returned (by default it returns every post)

    see this post for how to mod the query

    set your new params as $new

    limit to max 5 posts:
    $new = array('numberposts' => 5);

    limit to 5 posts per page:
    $new = array('posts_per_page' => 5);

    Posted 9 years ago #
  3. craw

    Thanks Helga-

    I just want 2 posts on the front page and then I want 5 to show up on the "blog" page that has the blog template applied.

    I'll give this a shot and see what I can make happen.

    Posted 9 years ago #
  4. craw

    I tried it and it's doing the same as before- 5 posts on the front page and 5 posts on the blog page.

    Any suggestions?

    Posted 9 years ago #
  5. also try duplicating template-blog.php into your child theme. you can adjust the query params directly there b/c that page template doesn't have a thematic_above_indexloop() hook

    and do check your reading settings in the WP dash.

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.