How to add "Posted by [username]" next to the date on each new post?
-
Using WordPress 3.5.1. Falling Leaves theme.
Currently, my template displays this info at the start of each new post:
“Posted 4:21 pm, Wednesday, April 17, 2013” (or whatever the date is).
What I want it to say is:
“Posted by [my username] at 4:21 pm, Wednesday, April 17, 2013.”
I presume this can be changed using the “Editor / Edit Themes” function under “Appearance” in the Dashboard sidebar.
It seems the most likely template that needs to be edited to make this change would be either “Main Index Template,” or possibly “Single Post.”
The problem is, I don’t see anything in the existing Falling Leaves code that seems to be an option for including a post’s author name to toggle on or off, so I’d have to add the code from scratch — something I have no idea how to do, since I know next to nothing about php or CSS or whatever it is.
In the “”Main Index Template” for the Falling Leaves template I see this code:
<div class="post"> <h2 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2> <div class="date">Posted <?php the_time('g:i a'); ?>, <?php the_time('l') ?>, <?php the_time('F') ?> <?php the_time('j') ?>, <?php the_time('Y') ?></div> <div class="storycontent"> <?php the_content('Read on »'); ?> </div>
It would seem likely that whatever I need to add to make “Posted by [my username]…” visible, it should be added somewhere in there.
What makes this tricky is that my blog has two separate admin users, each logging in with a different user name, and both making posts — and I want each author’s post of course to say “Posted by [this-particular-author’s-actual username]…”. In other words, the displayed user name needs to be dependent on who actually posted the post, and not be a static name in the template.
Any clue about how I can achieve this? I know it must be possible because lots of other blogs and themes have this feature — I simply need to know what code to use, and where to paste it in. Thanks.
- The topic ‘How to add "Posted by [username]" next to the date on each new post?’ is closed to new replies.