Wordpress How to exclude any category post to being display
Exclude/Stop any category posts to displayed on any page
As wordpress being used as CMS now a days, we need many trick to use it properly, coz our requirement are different each time when we develope any new site with WP.
Some time we dont want to show any particular category post on home page. or any other page, so this trick & hack best for you.
Exclude Posts in WP
Search this code
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
Replace with
<?php if ( have_posts() ) : query_posts($query_string .'&cat=-1,-2'); while ( have_posts() ) : the_post(); ?>
cat=-1,-2Â = these are category Id’s
you can also add numbers of post you want to show by using these trick
<?php if ( have_posts() ) : query_posts($query_string .'&cat=-1,-2&showposts=2&order=asc'); while ( have_posts() ) : the_post(); ?>
showposts= number of post you want to display,
Order by = its upto you to show ASC/DESC












