WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
<?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.

share|improve this answer
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 '11 at 3:35
can you clear the question a little bit more?? – Monirul Islam Oct 20 '11 at 6:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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