Skipping post formats from query


If I do not want to show some post formats in any type of listing using custom query then this code is very helpful.

$myposts = new WP_Query( array(
    'tax_query' => array(
        array(                
            'taxonomy' => 'post_format',
            'field' => 'slug',
            'terms' => array( 
                'post-format-aside',
                'post-format-audio',
                'post-format-chat',
                'post-format-gallery',
                'post-format-image',
                'post-format-link',
                'post-format-quote',
                'post-format-status',
                'post-format-video'
            ),
            'operator' => 'NOT IN'
        )
    )
) );

You may also like

LEAVE A COMMENT

@wiseguy112 میں بھی کہوں ان کی شکلیں کیوں نہیں ملتی آپس میں۔

@SSEHBAI1 @CMShehbaz His elder brother kind may be!

@nadia_a_mirza I believe that You have not chosen that for anyone but Allah. So don't bother answering stupid peopl… https://t.co/wIVIFHfvGx

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

affiliate_link

Categories