new limit authors

This commit is contained in:
arlemp@selectel.ru
2022-08-17 13:48:02 +03:00
parent e624534b02
commit cb7c116251

View File

@@ -664,6 +664,7 @@ add_action( 'init', function () {
add_action( 'pre_get_posts', function ($query) {
if ( ! is_admin() && $query->is_main_query() && is_category() ) {
// не админка и основной цикл страницы
@@ -682,12 +683,16 @@ add_action( 'pre_get_posts', function ($query) {
$query->set( 'posts_per_page', 25 );
}
if (is_author()){
$query->set( 'posts_per_page', 24 );
}
}
}
if ( !is_admin() && $query->is_main_query() && is_author()) {
$query->set( 'posts_per_page', 24 );
}
});