Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't think there is an easy parameter to say "all posts until this date", so you should implement the <code>posts_where_paged</code> filter. There, you can check for <code>!(is_archive() || is_search())</code>, because these two can continue as normal. For the other parts, you add a <code>" AND $wpdb-&gt;posts.post_date &lt; NOW()"</code> or something like that (but don't use now, since that will hide events that happen later today, and you probably don't want that).</p> <p><a href="https://wordpress.stackexchange.com/questions/175/marking-future-dated-post-as-published">A similar question was asked on the WordPress Answers Stack Exchange site</a> (in private beta until Aug 20 2010, so you can't visit it unless you pre-registered). Joe Hoyle's suggestion there was simple:</p> <blockquote> <p>If all you are wanting to do is add an extra date for 'show times', it may be easier to add a meta box which does exactly that - using the Publish date to spoof it could be potentially problematic, as WordPress will set it to "future" status whenever it is updated with a future publish date (I think), so you will have to be hooking every time a post is updated to set it back again. Also, that way you could reserve "Publish Date" for what it is intended.</p> <p>I would probably just use a <code>meta_key</code>, and a custom meta box. Though it depends how complex your queries are that show the posts.</p> <p>If you set the meta_value as a timestamp, you can order by the show time date still, or select before / after a certain date:</p> <pre><code>$events = get_posts('post_type=events&amp;meta_key=show_time&amp;meta_value=' . strtotime( '+1 week' ) . '&amp;meta_compare=&lt;&amp;orderby=meta_value'); </code></pre> <p>Would get all "events" with a showtime no later then a week from the current date. Note: The above is untested, but <em>should</em> work :)</p> </blockquote> <p>(This answer is community wiki so I don't get rep points for just reposting what Joe said.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload