How to set the number of results to display in search of a WordPress blog.
Add this line in fonction.php
Edit as desired line 5 the number of post you want to display per page in your results.
// Modifier le nombre de résultats de recherche
add_filter('pre_get_posts', 'wpm_search_results');
function wpm_search_results() {
if ( is_search() ){
set_query_var('posts_per_archive_page', 30);
}
}
Thanks to WPkube
0.0 rating
0 / 5 stars (0 view)