Useful WP_Query example in WordPress

By | July 16, 2016

// 1 Get Sticky post record by wp_query post__in and taxonomy tax_query parameter

#

			
            
            
            <?php echo $img['alt']; ?>
            
            Placeholder image
            '; ?>
            

 

// 2 Get posts exclude Sticky posts by wp_query post__not_in and taxonomy tax_query parameter

#

// 3 Exclude specific Category Posts from result by use wp_query operator NOT IN

#

// 4 WP_Query for fetch CPT event Order by post meta key event from Date with only Upcoming event

#