I am developing a site that has two different custom post types; one of them is called Articles and one is called Sketchpad. Sketchpad is user submitted content that is assigned a custom taxonomy term value of either; public or private. Public posts are shown on the site and private posts aren't.
The article post type caleld Articles is added in by administrators in the Wordpress admin area, articles do not have a custom taxonomy.
On the homepage I need to pull out both "article" and "sketchpad" post type posts and then sort them by date with newer posts as the top and older ones at the bottom.
My current code is as follows:
<?php $args = array( 'post_type' => array('sketchpad', 'article'), 'taxonomy' => 'type', 'term' => 'public' ); // Only show content from the sketchpad post type where the taxonomy of type is public query_posts($args); ?>
The code above works, to an extent. You see only the post type "sketcphad" has the taxonomy of type and a term value of "public" so the issue is the above query is also checking if posts of the type "articles" have the particular taxonomy and term value as well.
Is it possible to only make the taxonomy and term part of my query apply to the "sketchpad" post type and the post type of "article" doesn't have any filtering criteria applied to it? Basically what I am wanting to do is merge two different queries into the one and output the results.