Tag Archives: Post Categories

WordPress Hack To Remove Certain Categories From Being Displayed

This hack is useful for those who like to display certain category to chosen or registered users only. Add the following given code inside The Loop and choose the category (number) which you wish to remove from the display.

<?php
if ( have_posts() ) : query_posts($query_string .’&cat=-1,-2′); while ( have_posts() ) : the_post();
?>