admin管理员组文章数量:1287966
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 );
本文标签: postsquotBlog pages show at mostquot in setting not working
版权声明:本文标题:posts - "Blog pages show at most" in setting not working 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741326078a2372487.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论