[Plugin: Custom Field Template] Get today's date and compare to value in date picker
I am currently using Custom Field Template. I need to make everything as simple as possible for the client, and so to make an event I’ve created a custom field with the date picker tool displaying the date as mm/dd/yyyy (the preferred format; if possible would like to keep this).
Going into the backend, I’m trying to code the php for get today’s date and the query meta comparison. Here is the code I have:
<?php //Get today's date in the right format $todaysDate = date('m/d/Y'); ?> <?php query_posts('showposts=-1&category_name=Event&meta_key=StartDate&meta_compare=>=&meta_value=' . $todaysDate . '&orderby=meta_value&order=ASC'); ?>
This is not currently working and I can’t figure out what I’m doing wrong. Just to reemphasize, I am only trying to post events that have not yet occurred, hence why I need to make the comparison.
If I’ve made anything unclear let me know and I will clarify as soon as possible. And thank you in advance for any feedback.
- The topic ‘[Plugin: Custom Field Template] Get today's date and compare to value in date picker’ is closed to new replies.