Support » Fixing WordPress » Display dates on Every Post

  • Resolved techtoll

    (@techtoll)


    I have used a condition for displaying post which is older than 1 day. I have used the looping which something like this

    <?php
    $mylimit=1 * 86400; //1 day * seconds per day
    $post_age = date('U') - mysql2date('U', $post->post_date_gmt);
    if ($post_age < $mylimit) {
    	echo ("at ");
      the_time();
    }
    else {
    	echo ("on ");
    	the_date();
    }
    ?>

    This works fine on single post but on index page only one post displays the date if multiple posts have been done on the same page.

    How to modify it?

    Here is my blog.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Display dates on Every Post’ is closed to new replies.