Tag.php not showing respective tagged posts
-
I’m not sure what I’m doing wrong, but I’m willing to bet it’s a simple fix. I have a few custom post types, one called Arizona Wine and one called Arizona Beer. In each CPT I use the built in tags/category meta boxes. I’m only using the tag one. So for each CPT I use the tag field to list a city like “Tucson”.
In tag.php I’ve set up a new wp query and added
<?php single_tag_title(); ?>
at the top of the page to test whether or not the page works and it does. The page shows the “Tucson” tag title. Now, I built the query like so:$args = array( 'posts_per_page' => -1, 'tag' => get_queried_object(), 'post_status' => 'publish', 'orderby' => 'DESC', 'order' => 'title' ); $tag_query = new WP_Query( $args );
All I get on my page is the else statement “Posts under that tag are not found”.
I’m not sure why posts aren’t being shown. Anyone out there know what might be going on?
- The topic ‘Tag.php not showing respective tagged posts’ is closed to new replies.