Elegant way to include only published posts with get_objects_in_term()?

You can add 'post_status' => 'publish' in your query to retrieve only objects with status publish , this will work for get_posts, query_posts or $wp_query and to include also custom taxonomies you can use tax_query in your args list

Leave a Comment