I want to display a meta field between two dates, the admin can set the two dates via the custom fields.

How can i make such content show between the dates set?

Thanks Matt

1 Answer 1

<?php <br />
 function filter_where($where = '') {<br/>
$where .= " AND post_date >= '1980-05-11' AND post_date <= '2011-05-11'";<br/ >
    return $where;</br>
add_filter('posts_where', 'filter_where');<br/>
while (have_posts()) :<br/>

get meta data value and replace with the numeric date.

  • Hey, Thanks for the help but the code will display the posts content on the certain dates, i want to display only a certain part in the post. Is this possible?
    – Shoebox
    Oct 17, 2011 at 3:35
  • can you clear the question a little bit more?? Oct 20, 2011 at 6:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.