Forums

Author name needed to appear with each post but not doing it (2 posts)

  1. spabizgal
    Member
    Posted 5 years ago #

    Ok I am really new at this but would like my posts to have the authors name listed below their posts and right now they do not show up.

    Just installed WP a week ago 1-10-07.

    With this in mind, I have read it needs to go in the "loop", wich I assume is index.php but not understanding, when I open this file, where exactly do I insert the following

    <?php
    global $wp_query;
    $author = $wp_query->get_queried_object();
    echo $author->user_firstname . ' ' . $author->user_lastname;
    ?>

    If someone could paste in exactly the code that I should see in this index.php file that would come right before the ABOVE code is inserted, and also paste the code I should see that would be showing right AFTER it, I'd sure appreciate it.

    Also is the above code correct for the version I have installed if its only been a week ago?

    Just want to make sure I am doing this right.

    Anything else I have to do to enable / allow it to display or will this take care of it?

  2. moshu
    Member
    Posted 5 years ago #

    You are way over-complicating it. Learn about the template tags:
    http://codex.wordpress.org/Template_Tags
    sepcifically:
    http://codex.wordpress.org/Template_Tags#Author_tags
    more exactly:
    http://codex.wordpress.org/Template_Tags/the_author

Topic Closed

This topic has been closed to new replies.

About this Topic