WordPress.org

Ready to get started?Download WordPress

Forums

How to add DATE, TIME, and NAME on each post and page (2 posts)

  1. mwalgen44
    Member
    Posted 1 year ago #

    Hello,

    I'd like to the DATE, TIME, and my NAME to each post and page at my WordPress site. I found the code for each, but I do not know where to place it. And if you could in your reply, be specific with me. I am learning, learning, learning. Thank you.

    Mike

  2. riversatile
    Member
    Posted 1 year ago #

    Hi,

    Somewhere in single.php file, you should have this portion of code :

    <?php if(have_posts()) : ?>
    		<?php while(have_posts()) : the_post(); ?>

    This is the loop, once a post exists for the post URL, it displays the post.
    Then you should see this kind of code :

    <h3 id="post-<?php the_ID(); ?>" <?php post_class(); ?>><?php the_title(); ?>...</h3>
    This is the post title.

    You can try to add DATE, TIME and AUTHOR's NAME by adding this just after/below the poste title :

    <span class="date">Posted on <?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?></span>
    <span class="author">Writen by <?php the_author(); ?></span>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.