After the update to the new WordPress version, "Blog pages show at most" (Setting >> Reading) is not working. Even if I change the count as 5 there, the homepage shows 10 articles i. It is not changing even I change to any count.
For more information, I have two blogs that have the same theme and same WordPress version. One blog has 150 articles, and the other has 300 articles. 300+ article blogs faced this issue. Are there any changes that happen after publishing 300+ articles in WordPress? List 10 articles must show on the home screen as default? Any idea to solve this issue ?
I have found this code in the function.php is there anything to change
**
* Check if Latest Posts are being displayed on homepage and set
posts_per_page accordingly
*/
function mts_home_posts_per_page( $query ) {
global $mts_options;
if ( ! $query->is_home() || ! $query->is_main_query() ) {
return;
}
$set_posts_per_page = 0;
if ( ! empty( $mts_options['mts_featured_categories'] ) ) {
foreach ( $mts_options['mts_featured_categories'] as $section ) {
if ( 'latest' === $section['mts_featured_category'] ) {
$set_posts_per_page = $section['mts_featured_category_postsnum'];
break;
}
}
}
if ( ! empty( $set_posts_per_page ) ) {
$query->set( 'posts_per_page', $set_posts_per_page );
}
}
add_action( 'pre_get_posts', 'mts_home_posts_per_page' );
// Map images and categories in group field after demo content import.
add_filter( 'mts_correct_single_import_option', 'mts_correct_homepage_sections_import', 10, 3 );
mts_home_posts_per_page()
or just comment out the call toadd_action( 'pre_get_posts', 'mts_home_posts_per_page' )
to see if that changes the behavior you are seeing. I also suggest checking to see if there are any options with the theme you are using to control how many posts are presented at one time on the homepage of your site.