WordPress.org

Ready to get started?Download WordPress

Forums

How to include author's name in post information line? (6 posts)

  1. thuyutexas
    Member
    Posted 7 years ago #

    Hi,

    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!

    Twee

  2. Chris_K
    Member
    Posted 7 years ago #

    Have a look at http://codex.wordpress.org/Template_Tags#Author_tags

    the_author() might be a good one to use.

  3. thuyutexas
    Member
    Posted 7 years ago #

    This is how it currently reads in the "Single Post" file:

    <div class="entry single">

    <h2>"><?php the_title(); ?></h2>

    <p class="info">
    <?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>

    <?php the_content();?>

    <p id="filedunder">Entry Filed under: <?php the_category(','); ?></p>

    </div>

    --------

    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?

    Thanks.

  4. moshu
    Member
    Posted 7 years ago #

    This
    <!--
    and this
    -->
    result in nothing being shown what is in between! (BTW, basic HTML lesson!) Remove it.

  5. thuyutexas
    Member
    Posted 7 years ago #

    Thanks, I did it!

  6. dreamsend
    Member
    Posted 6 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic