[resolved] Matching current date to post date (3 posts)

  1. sdjentertainment
    Posted 6 years ago #

    Hey Hey,

    I'm doing this side projects and using the mighty wordpress for it. The content is going to get updated regularly and would like to display a "new" icon for everything posted that day.

    Was wondering if anyone new how to set up a ifelse statement so I can check if the current date equals the post date and if so do something and if it doesn't do nothing.

    Anything would help and thanks for taking time.



  2. Have you seen this post? http://wordpress.org/support/topic/313756

    I think you could do this:

    <?php if (strtotime($post->post_date) > strtotime('-1 days')): ?> <b>NEW</b> <?php endif; ?>

    And that would do today. I think.

  3. sdjentertainment
    Posted 6 years ago #

    Thanks grand,

    I don't have time to test it out today, but once I do I'll post the solution

    Thanks for taking the time.

Topic Closed

This topic has been closed to new replies.

About this Topic