• Resolved joelmellin

    (@joelmellin)


    Hi,

    We use Fibosearch for people to search for products in our webshop. When people search for products we want to be able to adjust the number of posts per page that are visible. We got this code from Fibosearch:

    // Custom posts per page value for Search Results Page add_action( ‘pre_get_posts’, function ( $query ) { if ( $query->is_search() && ! is_admin() && $query->is_main_query() ) { $query->set( ‘posts_per_page’, 48 ); } } );

    The code is working with other themes, but not with our theme OceanWP. Somehow OceanWP takes control over maximum number of products per page, which is 8 products only.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @joelmellin,

    Thank you for your report,
    This topic is forwarded to the developer team and will be fixed/improved for the next updates.

    I appreciate your patience until the issues are resolved.

    Best Regards

    Thread Starter joelmellin

    (@joelmellin)

    Thanks. By adding 9999 to the codesnippet it solved the problem:

    // Custom posts per page value for Search Results Page add_action( ‘pre_get_posts’, function ( $query ) { if ( $query->is_search() && ! is_admin() && $query->is_main_query() ) { $query->set( ‘posts_per_page’, 48 ); } }, 9999 );

    Hello @joelmellin,

    Thank you for the update.
    I attempted to add 99, but a higher priority seemed necessary. I’m glad that you were able to resolve the issue.

    Best Regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conflict with search’ is closed to new replies.