Query to show events from today.
-
I have been trying to use the code below to display posts that have today’s date in the Custom Field I created named ‘Date’. I only want to display today’s events, not anything in the past or future. I’m not sure what I need to modify to get this working. I am definitely not a PHP programmer, so I could use some help.
// Get today's date in the right format $todaysDate = date('m/d/Y g:i:a'); echo '<h3 class="widgettitle">Today’s Events</h3>'; echo '<ul>'; query_posts('showposts=5&category_name=events&tag=main,lucasville,wheelersburg,newboston,southwebster,computer,kids&meta_key=Date&meta_compare=>=&meta_value=' . $todaysDate . '&orderby=meta_value&order=ASC'); if ( have_posts() ) : while ( have_posts() ) : the_post();
Thanks,
T
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Query to show events from today.’ is closed to new replies.