0
Welcome Guest! Login
0 items Join Now

Gantry and displaying only 1 search result

  • Gantry and displaying only 1 search result

    Posted 10 years 8 months ago
    • I understand Gantry will not use the "Blog pages show at most" setting found under Settings->Reading because it causes issues. I also understand you are supposed to change a setting under Theme Settings->Blog View or Theme Settings->Search View to get the preferred number of search results to show. BUT this is not working. I am using Graffito and can't find where to set the number of search results to display. Currently it just displays one!

      I found this:
      function trance_posts_per_page( $query ) {
          $query->set( 'posts_per_page', 20 );
      }
      add_action( 'pre_get_posts', 'trance_posts_per_page' );
      and it works great for the search results (besides some custom pagination needed), BUT it also changes the Admin->Pages results too. So it will only display 20 pages in the Admin area and there is no pagination to see the rest.

      Any fixes for displaying more than 1 search result?
  • Re: Gantry and displaying only 1 search result

    Posted 10 years 8 months ago
    • No one else have this issue? I know it's Gantry because of this in the functions file:

      // This will always set the Posts Per Page option to 1 to fix the WordPress bug
      // when the pagination would return 404 page. To set the number of posts shown
      // on the blog page please use the field under Theme Settings > Content > Blog > Post Count
      function gantry_posts_per_page() {
      	if( get_option( 'posts_per_page' ) != '1' ) update_option( 'posts_per_page', '1' );
      }
  • Re: Gantry and displaying only 1 search result

    Posted 10 years 8 months ago
    • Nevermind, I'm just using WP-pagenavi plugin.

Time to create page: 0.053 seconds