Wordpress, if in the last X days

/ Published in: PHP
Save to your folder(s)

To be placed inside a loop or a query

Copy this code and paste it in your HTML
  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


RSS Icon Subscribe to comments

You need to login to post a comment.