Number of WordPress search result

 

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


[site_reviews_summary assigned_to=”post_id”]

Cancel
[site_reviews_form assign_to=”post_id”]
Rate this article

[site_reviews display=10 assigned_to=”post_id”]

Leave a Reply

Your email address will not be published. Required fields are marked *