• I need to be able to hide multiple categories from my blog. Currently I have some code that works for hiding one category but I am not sure how to change it to work for multiple categories. My WordPress/PHP knowledge is on the lower end and I have no been able to find a solution that works with my current code. I believe it should be a simple solution, just not sure what the exact code is.

    This is my current code. As you can see the category with ID 3 does not show. I need to also hide the category with an ID 6.

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    
    $args = array(
    'posts_per_page' => 4,
    'paged' => $paged,
    'cat' => -3
    );
    
    query_posts($args);
    ?>
Viewing 1 replies (of 1 total)
  • @jgreenberg1990 you are very near to your solution you just need to update the key ‘cat’s value to something like

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    
    $args = array(
    'posts_per_page' => 4,
    'paged' => $paged,
    'cat' => -3,-6,-9,place your category with (-) comma separated if multiple here
    );
    
    query_posts($args);
    ?>

    For further instructions please follow the Link
    Please let me know if this resolve your problem

Viewing 1 replies (of 1 total)
  • The topic ‘Hiding Multiple Blog Categories’ is closed to new replies.