[SOLVED] Showing Posts With 'Draft' Status
Hi,
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() ) { ?> 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 |
I'm unclear with youre statement
Quote:
|
Sure sorry for the confusion. So as an example, lets say the site is on concert tour dates. I use categories to classify between rock, pop, etc and tags to classify the actual tour. So as an example, a tag might be Oasis 2009 Concerts. I'm using a plugin that lets me set a date for an expiration that moves the posts to draft from published. So Each tour date has its own post and the expiration date is the concert date. So I don't want that post showing in the loop, which is my 'Up Coming Shows' area, when someone views the Oasis 2009 Concert tag page. But I do want to show past shows. I was hoping on showing them below the loop, keeping them as drafts but still showing them to the public under say 'Past Shows.' Not sure how I show draft posts below the loop?
|
ok, you need to build a new wp_query since 'the loop' is finished. Here is a sample you can play with that I grabed and modified a bit (from http://blog.complimedia.com/show-upc...sts-wordpress/)
HTML Code:
<?php |
Thank you. I did already try something like that and like you said, it pulls all draft posts. I'll have to dig on the logic cause I think that's where I'm stuck. If I'm on the Oasis 2009 Tour tag page, I only want to pull posts that have that tag.
|
you just need to add the category or tag to the wp_query parameters.
|
Well, here's my finished code that's working so far. I wanted to post it in case someone else was interested:
Code:
<?php if ( is_tag() ) { ?> |
All times are GMT -6. The time now is 12:05 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.