From 00164c05f1be11eec7c6af1517d7c6e8bce4e9d5 Mon Sep 17 00:00:00 2001 From: AK Delfin Date: Tue, 16 Aug 2022 19:59:08 +0300 Subject: [PATCH] add limit 24 in mainpage --- functions.php | 12 ++++++++---- index.php | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/functions.php b/functions.php index 180963c..6872385 100644 --- a/functions.php +++ b/functions.php @@ -668,18 +668,22 @@ add_action( 'pre_get_posts', function ($query) { // не админка и основной цикл страницы // $category = get_queried_object(); - // var_dump($category); exit; + // var_dump($category); exit; + - if ( is_category( 'arkhiv' ) ) { $query->set( 'posts_per_page', 8 ); } 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()){ - $query->set( 'posts_per_page', 23 ); + $query->set( 'posts_per_page', 24 ); } diff --git a/index.php b/index.php index 4fbb70e..9588666 100644 --- a/index.php +++ b/index.php @@ -18,7 +18,7 @@ $nn = 0;?> array( 'category__in' => array(2), 'post__not_in' => array($mainpost_id), - 'posts_per_page' => 22, + 'posts_per_page' => 24, 'meta_query' => array( array( 'key' => '_thumbnail_id',