Add new in title
-
I want to put in New in posts that where added in todays date and when they are older than a day then go away I have tried this code but it is not working, You guys have any ideas?
<?php $todaysdate= date('d/m/d');?> <ul> <?php foreach( $posts as $post ) : setup_postdata( $post ); ?><br /> <?php if (the_time('d/m/y' == $todaysdate) {?> <li <?php post_class(); ?>><small style="font-size: 9px; color: #0000FF;"><?php the_time('d/m/y'); ?></small> - <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php } else {?> <li <?php post_class(); ?>><small style="font-size: 9px; color: #777;"><?php the_time('d/m/y'); ?></small> - <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php } endif; endforeach; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Add new in title’ is closed to new replies.