ThemeShaper Forums » Thematic

[closed]

number of home page posts

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

    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 } }
    add_action('thematic_above_indexloop','single_post_on_homepage');

    Posted 2 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
    http://forums.themeshaper.com/topic/how-do-i-show-oldest-posts-first#post-23196

    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 2 years ago #
  3. craw
    Member

    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 2 years ago #
  4. craw
    Member

    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 2 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 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.