Forums › Forums › Search & Filter Pro › Results per page won't update/not working
Tagged: posts per page, Results per page
- This topic has 10 replies, 2 voices, and was last updated 5 years ago by Trevor.
-
Anonymous(Private) November 21, 2019 at 5:50 pm #227259
Hello,
We are having an issue with the “Results per page:” setting on the general tab not updating the number of search results per page. We seem to be stuck at 5 search results per page: Courses Archive Search Results Page
I also tried resetting the results per page with the
pre_get_posts
action to no avail. Here’s that code:
`
// Set Posts per page
function wpd_courses_query( $query ){
if( ! is_admin()
&& $query->is_post_type_archive( ‘courses’ )
&& $query->is_main_query() ){
$query->set( ‘posts_per_page’, 10 );
}
}
add_action( ‘pre_get_posts’, ‘wpd_courses_query’ );
`
Any help would be much appreciated.
Trevor(Private) December 4, 2019 at 2:52 pm #228332So, I can deduce that something is setting this 5 posts per page, and it is not the standard WordPress setting (in the Reading options in settings), nor our plugin.
It will be one of these things:
1. The theme. Via a theme function, a template file, or the functions.php file.
2. Custom code
3. Another pluginThe only possible plugin I can see SROM Courses, I checked. It is not there.
What happens if you switch the Divi parent theme?
Anonymous(Private) December 4, 2019 at 8:01 pm #228390Ah, it is the Divi theme. Thank you, I didn’t even think to look there as I am not used to a theme setting that.
I guess I will have to see if there is a way to override that with Divi as it is rather annoying that it sets it globally. Also that Search and Filter doesn’t override the setting. For now though, I will just set it through Divi.
Thank you!
-
AuthorPosts