functions – How to Not Show posts on Category page?

Question

i simply dont want to show posts on category page and show the description only, i tried this code but it wont work if i use the zero value, 1+ value would work but not 0

add_filter('pre_get_posts', 'posts_in_category');
function posts_in_category($query){
    if ($query->is_category) {
        if (is_category('')) {
            $query->set('posts_per_archive_page', 0);
        }      
    }
}

0
RJM 1 month 2021-08-08T14:30:51-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse