Front Page Max # Posts affecting Widget Recent Posts count

Homepage Community Forums Ambition Front Page Max # Posts affecting Widget Recent Posts count

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #19208
    Rob
    Customer

      I have a widget area in the footer that shows recent 5 posts.

      On the front page, it shows 2, not 5

      on every other page, it shows 5.

      I’m certain this is because the front page is set to show only 2 posts and it’s affecting the loop and then the widget.

      Anyone else notice this and / or have a fix?

      it’s the functions.php line 262’ish

      #19252
      Wes
      Moderator

        “On the front page, it shows 2, not 5

        on every other page, it shows 5.

        The demo shows 5 posts on the front page and every page after that – http://demo.appfinite.net/ambition/ Did you add any other code or change any settings somewhere?

        “it’s the functions.php line 262’ish”

        The functions file only goes up to line 259, and at the bottom of the functions file are the homepage widgets. Are you referring to something else?

        #19387
        Rob
        Customer

          well shoot. I did that I guess.

          /** reduce number of posts on homepage **/
          add_action( ‘pre_get_posts’, ‘set_posts_per_page’ );
          function set_posts_per_page( $query ) {

          if ( is_home() )
          $query->set( ‘posts_per_page’, 2 );

          return $query;
          }

          I only want 2 posts to show on front page, but it’s affecting the widget area too.

          Shoot.

          #19388
          Rob
          Customer

            disregard. I just removed that code and used the settings -> reading panel instead. Set it to 2 there.

            #19409
            Wes
            Moderator

              Great, Glad everything is working!

            Viewing 5 posts - 1 through 5 (of 5 total)
            • The topic ‘Front Page Max # Posts affecting Widget Recent Posts count’ is closed to new replies.