• Im trying to figure out through whatever means (php most likely) to figure out if a post is X days old and if it is echo a div.

    I want to make a div appear for new posts to add some information telling the user its new, prob. with an image bg of the div.

    if anyone can help that would be greatly appreciated.

Viewing 2 replies - 16 through 17 (of 17 total)
  • sure, you can call your function like that, the functions.php is already included by the header.. I tried to figure out what’s going on with that newsalertdiv thing you would like to have, but like SS_Minnow said, it takes too much time for gettin this worked.. And I’m not a php crack.

    Im trying to figure out through whatever means (php most likely) to figure out if a post is X days old and if it is echo a div

    without a script, (has to be within the loop):

    <?php
    $age = date('U') - get_the_time('U');
    $daysago=$age/(60*60*24);
    if($daysago<=X) : ?>
    <!-- html output of your extra stuff -->
    <?php endif; ?>

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘New Posts’ is closed to new replies.