Exclude particular category posts by query post in wordpress

Sometime we don’t want to show the posts from the specific category so here is the code that help you to exclude that particular category posts from the posts.


       query_posts(array( 

        'post_type' => 'post',

        'showposts' => 14,
		   
		'category__not_in' => 10,   
		
		 'meta_query' => array(
        'relation' => 'OR',
        array(
            'key' => 'nst_hide_front_post',
            'value' => 'Yes',
            'compare' => '!='
        ),
        array(
            'key' => 'nst_hide_front_post',			
            'compare' => 'NOT EXISTS'
        )
    ),

		'paged' => $paged,	
		

         ) );  

If you still need help then contact with me . 🙂

Thanks 🙏

If this help you then.. Can you buy a Cup of Coffee for me by nst webcreation paypal--OR-- nst webcreation blog coffee cup

Published by

NST

Myself Narender Singh Thakur ( NST ) and i share my Experience/Knowledge and Tricks for folks and beginners to solve their issues while making websites through this Planet.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Click to Chat