WordPress.org

Ready to get started?Download WordPress

Forums

Spun
[resolved] Number of Posts on Main Page (2 posts)

  1. etourneau2
    Member
    Posted 1 year ago #

    I am trying to get more than the basic ten posts to be listed on the main page without having to expand via the "older posts" button. I have attempted to change the number via the settings - reading tab, with no luck. I actually am currently using a child theme because of some other customization that I have done, but have the same problem even when I activate the main theme. Please let me know what I can do to fix the problem. Please help. Thanks

    http://www.etourneau.org

  2. Caroline Moore
    Member
    Theme Author

    Posted 1 year ago #

    You're using Infinite Scroll, which will always return 10 posts by default. You can override this with a filter in your child theme's functions.php:

    function my_theme_posts_per_page( $args ) {
      $args['posts_per_page'] = 15; //Or however many posts you want to display
      return $args;
    }
    add_filter( 'infinite_scroll_settings', 'my_theme_posts_per_page' );

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.