WordPress.org

Ready to get started?Download WordPress

Forums

Special Class for Today's Post (3 posts)

  1. courtneyelizabeth
    Member
    Posted 7 years ago #

    Is there a php code that is used when you would like to use a special class for posts that were written today?

    something like:

    <?php $today = date('F jS, Y'); ?>
    <div class="entry<?php if ($today = the_time('F jS, Y')) { ?>today<? }else{ ?><?php }?>">

    Doing this simply echoes the date in the template. It's driving me crazy.

    Any help would be really appreciated. :)

  2. courtneyelizabeth
    Member
    Posted 7 years ago #

    welp...figured it out...this can be closed. thanks. :)

  3. Chris_K
    Member
    Posted 7 years ago #

    But first you have to share your answer for the next person who searches. :-)

Topic Closed

This topic has been closed to new replies.

About this Topic