Posted By

davebowker on 01/22/09


Tagged

php time date wordpress x days Since


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

nerdfiles
umang_nine
maxvee8
BrianCoyDesign
clintonhalpin


Wordpress, if in the last X days


 / Published in: PHP
 

To be placed inside a loop or a query

  1. <?php $mylimit=31 * 86400; $post_age = date('U') - get_post_time('U'); if ($post_age < $mylimit) { ?><img class="new" src="<?php bloginfo('template_url'); ?>/images/new.png" alt="" border="0" /><?php } ?>

Report this snippet  

You need to login to post a comment.