How do I post the name of the author and the time of the post on the published post? I’m asking how to add the name and time to the post at the time of publishing, not asking about sorting in the admin page, but actually letting the reader know who the author of the post is and when the post was made.
OK, so I’m thick. I don’t know what it’s talking about the Loop. I am using WP 1.5, I can see on the post admin site the post number, author and time. How do I transfer the author and time to the actual post so the readers know who is posting the post? If I need a plugin please tell me. If I need code please tell me what code and where to put it so it does what I want it to do.
Which theme are you using? Many themes do show the author and the time of the post.
Take a look at the Classic theme’s
index.phpfile to see how the template tags are included in the templates. Usually it is in the post div, something like this:
<h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> — <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?>
You can notice the
<?php the_author() ?>template tag and the
<?php the_time() ?>template tag, which will display the author and the time.
Using the Kubrick theme. Let me read what you have posted and see if that’s what I need.
This is my entire index.php entry. I don’t see what you are referencing. Do I need to add something and if so does it need to be added for each poster in order to post the poster’s name on her posts?
<?php get_header(); ?>
<div id=”content” class=”narrowcolumn”>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<h2 id=”post-<?php the_ID(); ?>”>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></h2>
<small><?php the_time(‘F jS, Y’) ?> <!– by <?php the_author() ?> –></small>
<?php the_content(‘Read the rest of this entry »’); ?>
<p class=”postmetadata”>Posted in <?php the_category(‘, ‘) ?> | <?php edit_post_link(‘Edit’,”,’|‘); ?> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?>
<?php trackback_rdf(); ?>
<?php endwhile; ?>
<div class=”alignleft”><?php posts_nav_link(”,”,’« Previous Entries’) ?></div>
<div class=”alignright”><?php posts_nav_link(”,’Next Entries »’,”) ?></div>
<?php else : ?>
<h2 class=”center”>Not Found</h2>
<p class=”center”><?php _e(“Sorry, but you are looking for something that isn’t here.”); ?>
<?php include (TEMPLATEPATH . “/searchform.php”); ?>
<?php endif; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
I do see what you’re referencing now that I can compare side by side, but do I fill in the blanks with something and if so which blanks and what type of information do I put in them?
Sorry for being such a dumbbell
1. Please, don’t post here long code portions. Even you have to put up here code lines, use the
backticks– as instructed below the text area here!
2. When you need to show long posts, it is recommended to paste them on this site: http://pastebin.com/ and post back with the url.
3. You just have to put the template tags as I quoted above (
<?php the_author() ?>) WP will do the rest for you 🙂
You need to add the tags to your index.php template.
The tags are <?php the_author() ?> and <?php the_time() ?>
Copy and paste them in where you want the info to show.
I’ve pasted the codes and the time is now showing up but not the author. Here’s the way it reads in my index.php file (appropriate line only) 🙂
<!– by <?php the_author() ?> ) –></small>
Any clues as to what I am doing wrong? I just added the code you indicated without taking out anything in front of or behind it. Is that my problem?
Yes, you “commented it out” 🙂
<!--in front and the
Make it like
by <?php the_author() ?> </small>
- The topic ‘Post name of author and time of post on published post’ is closed to new replies.