add limit 24 in mainpage

This commit is contained in:
2022-08-16 19:59:08 +03:00
parent c1cf264f28
commit 00164c05f1
2 changed files with 9 additions and 5 deletions

View File

@@ -668,18 +668,22 @@ add_action( 'pre_get_posts', function ($query) {
// не админка и основной цикл страницы // не админка и основной цикл страницы
// $category = get_queried_object(); // $category = get_queried_object();
// var_dump($category); exit; // var_dump($category); exit;
if ( is_category( 'arkhiv' ) ) { if ( is_category( 'arkhiv' ) ) {
$query->set( 'posts_per_page', 8 ); $query->set( 'posts_per_page', 8 );
} }
else { else {
$query->set( 'posts_per_page', 23 ); $query->set( 'posts_per_page', 25 );
}
if (is_front_page()) {
$query->set( 'posts_per_page', 25 );
} }
if (is_author()){ if (is_author()){
$query->set( 'posts_per_page', 23 ); $query->set( 'posts_per_page', 24 );
} }

View File

@@ -18,7 +18,7 @@ $nn = 0;?>
array( array(
'category__in' => array(2), 'category__in' => array(2),
'post__not_in' => array($mainpost_id), 'post__not_in' => array($mainpost_id),
'posts_per_page' => 22, 'posts_per_page' => 24,
'meta_query' => array( 'meta_query' => array(
array( array(
'key' => '_thumbnail_id', 'key' => '_thumbnail_id',