Showing Posts With ‘Draft’ Status
-
Hi,
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 (I’m using Atahualpa theme which is fantastic so I’m putting it in below the loop). Here is one of my attempts.
<?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 } ?>Right now, this only prints out ‘nothing scheduled’ so its not quite working right.
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. Any help would be great
The topic ‘Showing Posts With ‘Draft’ Status’ is closed to new replies.