[Resolved] Number of posts on blog/home vs category

Home Forums Support [Resolved] Number of posts on blog/home vs category

Home Forums Support Number of posts on blog/home vs category

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #226934
    David

    Is there any way to have a different number of posts on the blog/home page vs categories/archives?

    So for example, I’d like to display 7 posts on the home page but have 12 posts on the categories/archives.

    The reason I want to do this is so that my home page can have one large featured post at the top, and 6 smaller posts in two columns below. And then on the category page I can have 9 posts (all the same size) in three columns. If I use the same number for both then I’ll be left with an uneven number of posts in the final row on one of the sections (which doesn’t look good).

    I know this could be achieved by using the WP Show Posts plugin to create a custom home page, but ideally I would prefer not to use that since it makes it more difficult to display the posts how I want to.

    Thanks!

    #226998
    David

    I think I may have found a solution here ๐Ÿ™‚

    #227002
    Tom
    Lead Developer
    Lead Developer

    Something like this might help: http://wordpress.stackexchange.com/questions/47683/using-pre-get-posts-to-set-posts-per-page-how-do-i

    Your conditional would be: if ( $query->is_category() ) :

    #227035
    David

    Even better, thanks Tom!

    #227038
    Tom
    Lead Developer
    Lead Developer

    No problem ๐Ÿ™‚

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.