I’m using Blix as the theme for my blog (www.nguyenthuy.net/myblog/, most of it is in Vietnamese so you don’t have to worry if it doesnt display right, or it happens that you can and want to read Vietnamese then go to View –> Character Encoding and choose Unicode).
Now in the post information line, I have “Add comment” and then the date of posting. As this blog is for my whole family, we will have different people posting. I want to include the author’s name in this line, too. How do I do that? Please give me specific instructions as I am pretty much html illiterate.
Thanks a bunch in advance!
Have a look at http://codex.wordpress.org/Template_Tags#Author_tags
the_author() might be a good one to use.
This is how it currently reads in the “Single Post” file:
<div class=”entry single”>
<h2>“><?php the_title(); ?></h2>
<?php if ($post->comment_status == “open”) ?>
<em class=”date”><?php the_time(‘F jS, Y’) ?><!– at <?php the_time(‘h:ia’) ?>–>
<!–<em class=”author”><?php the_author(); ?>–>
<?php edit_post_link(‘Edit’,'<span class=”editlink”>’,'</span>’); ?>
<p id=”filedunder”>Entry Filed under: <?php the_category(‘,’); ?></p>
So the tag is in there I guess (it was there originally, I did not add anything in). But it’s not showing. What else do I have to do?
result in nothing being shown what is in between! (BTW, basic HTML lesson!) Remove it.
Hi…I have removed the comment marks from the author portion of the code but it hasn’t worked.
<?php the_time('M d, Y') ?> <by <?php the_author() ?> > in <?php the_category(', ') ?>
This is the way it appears now, it had the “!–” before originally. This is in the theme’s (Purple Rain) index page. It’s also the code that now shows up when I click on “main index template” when I go to this file via the template editor.
I’ve seen several posts about this, but I can’t find one that addresses what to do when the instructions in the codex do NOT work. Can anyone help? Is it possible that “the_author” has a new tag in my theme? I know nothing about php and was surprised I had to get this far into coding just to make different author names show up.
- The topic ‘How to include author’s name in post information line?’ is closed to new replies.