• Resolved jay0000

    (@jay0000)


    Hello, am trying to have date and time show up on each post. have went through a few forum topics but I’ve highlighted what I’m running into below….

    <a href="<?php the_permalink(); ?>"><?php dp_attachment_image($post->ID, 'thumbnail', 'alt="' . $post->post_title . '"'); ?></a>
    		<a href="<?php the_permalink(); ?>" class="title"><?php the_title(); ?></a>
    		<div class="datemeta"><?php the_date(); ?> at <?php the_time() ?></div>
    		<p><?php echo dp_clean($post->post_content, 250); ?></p>

    I added in the part that reads <div class=”datemeta”><?php the_date(); ?> at <?php the_time() ?></div>

    However, this makes it so the first post on my front page shows the date and time, but all subsequent posts after just show the time. Does this code need to be put in any other php files so that every post on my site will show date and time. Even just the date would work for now, as by default nothing is showing up. (I am using a schemer mag theme on my site)

    Also- even though the most recent post shows the date and time, when I actually click on the post to take to the actual post page, there is no date or time.
    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Try replacing <?php the_date(); ?> with <?php the_time(); ?>.

    Thread Starter jay0000

    (@jay0000)

    Thanks, but that just removed the date, and now just the time shows.

    However, when clicking on the post link, when the actual post page is viewed, there is still no information on the date or time of posting, – only shows up on the front page.

    I inserted the code in the same place in archive.php, single, and search as well

    Something like:

    <div class="datemeta"><?php the_time() ?></div>

    should work in each of those files too.

    Thread Starter jay0000

    (@jay0000)

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Date and Time on Posts’ is closed to new replies.