php - Exclude post_type or pages -
i trying exclude specific post_type or pages, not sure if thinking correctly. issue pages comes in while query supposed dedicated (almost) posts.
here dealing with:
$args = array( 'post_type' => 'any', 'posts_per_page' => '-1', 'post_taxonomy' => 'any', 'cat' => -14, ); i thinking writing 'post_type' => 'any' posts, remember didn't work custom posts.
do have working solution?
thanks
if talking filtering post wp_query should read here https://codex.wordpress.org/class_reference/wp_query
basically can use lot of filters, example:
$args = array( 'post_type' => 'post', 'cat' => -14, 'post__not_in' => array( 2, 5 ) ); $query = new wp_query( $args ); this find posts (not pages), not in category id 14 , not post id 2 or 5.
now if more precise in question give exact array need obtain it.
Comments
Post a Comment