Count posts without assigned taxonomy
I’m designing knowledge base that has several custom post-types and several sub-categories in a taxonomy I called ‘sub’. In order for the post to show up in the proper location, a sub-category must be chosen, or the post will be floating around and not linked to from anywhere.
Because of that, what I would like to do is run a query that will pull a list of posts (of any custom post-type), that are not associated with a taxonomy.
I know how to pull a list of posts of a certain post-type and taxonomy, but I don’t know how to run a query based on what I’m looking for. I’m unsure if I can modify the below query to pull the information I’m looking for.
<ul> <?php $loop = new WP_Query( array( 'post_type' => array('post-types'), 'sub' => 'sub-cats', 'posts_per_page' => 500, 'post_status' => 'publish', 'orderby' => 'title', 'order' => 'ASC' ) ); while ( $loop->have_posts() ) : $loop->the_post(); echo '<li><a href="'. get_permalink() .'">'. get_the_title() .'</a></li>'; endwhile; ?> </ul>
Is this type of thing even possible in 3.0.4?
Please forgive me if my terminology is unclear, I’m fairly new at this. Thanks!
- The topic ‘Count posts without assigned taxonomy’ is closed to new replies.