Trying to figure this out and wondering if anyone here could help. I'm looking to show my posts with draft status. I've seen some codes that work but not for exactly what I'm looking to do. Most of them will list all drafts which is great but not exactly what I want to do. I only want to show draft posts on tag pages and I only want to show drafts with that tag. So I have entered the following code after my loop in the content below the loop section. Here is one of my attempts.
Code:
<?php if ( is_tag() ) { ?> <?php /* If there are any posts: */ if (post_status == "draft" ): ?> <div class="sidebar-box"> <?php while (have_posts()) : the_post(); ?> <ul> <li> <?php the_title(); ?> </li> </ul> <?php /* END of the LOOP */ endwhile; ?> <?php /* END of: If there are any posts */ else : /* If there are no posts: */ ?> <div> <ul> <li><?php _e('Nothing scheduled'); ?></li> </ul> </div> <?php endif; ?> </div> <?php } ?>
I also tried doing a new query but then those posts won't match the tag. Maybe I could put a statement where it only prints if it equals the tag? Not sure what's the best way here. I tried looking into the theme files but I'm not very good at following the code to see what I can do. Any help would be great