I have an events page that uses the following query:
<?php $portfolioloop = new WP_Query( array( 'post__not_in' => array(4269), 'paged' => get_query_var('paged'), 'post_status' => 'future', 'post_type' => 'whatson', 'exclude' => '4269', 'posts_per_page' => 20, 'order' => 'ASC')); ?>
All this does is show a list of all scheduled custom posts and when the post hits the scheduled date it publishes the page... thus removing it from the list.
It's nearly what I want, when it hits the publish date, the event is actually running on that day so removing it from the list isn't quite correct.
Is there a way I can delay removing it from the list until the end of the day?
p.s I don't want to use a plugin as I don't think it warrants it.
I've found this:
$args = array(
'posts_per_page' => 3,
'meta_key' => 'event-start-date',
'orderby' => 'meta_value',
'order' => 'ASC',
'meta_query' => array(
array( 'key' => 'event-end-date', 'compare' => '>=', 'value' => date('Y-m-d') )
)
);
query_posts($args);
I don't want to sort by a custom field so how can I do it by the post publish date?