Make your new posts stands out
Make your new posts stands out
Why not giving a special style to the posts published less than 24 hours ago, to let your readers know about the fact they’re new? Here’s a simple code to do it.
To achieve this recipe, edit your index.php file and look for the loop. Replace it with that one:
< ?php if (have_posts()) : ?>
< ?php while (have_posts()) : the_post(); $currentdate = date(‘Y-m-d’,mktime(0,0,0,date(‘m’),date(‘d’), date(‘Y’))); $postdate = get_the_time(‘Y-m-d’); if ($postdate==$currentdate) { echo ‘
‘; } else { echo ‘
‘; } ?>