WordPress.org

Ready to get started?Download WordPress

Forums

How to make the name of the author display (11 posts)

  1. weejy
    Member
    Posted 8 years ago #

    I want to name of the author to show for each entry - how is this done?

  2. devilmaycry
    Member
    Posted 8 years ago #

    Just add this php code to your template to display the post authors name:

    <?php the_author(); ?>

  3. weejy
    Member
    Posted 8 years ago #

    Please help out a newbie - which file do I modify, and where in it do I place the code? I'm using the default.

    Thanks

  4. vkaryl
    Member
    Posted 8 years ago #

    Check your index.php file. Within the stuff known as The Loop, you may see that code already there, surrounded by "comment tags" like these:

    <!-- -->

    Take out those comment tags and you should have the author's name in posts.

  5. weejy
    Member
    Posted 8 years ago #

    Sorry - I forgot to mention I'm running 2.02
    My index.php file just says "short and sweet" and "require header".

  6. MichaelH
    Member
    Posted 8 years ago #

    That would be the index.php file in your wp-content/theme/whateverthemeyouareusing folder.

  7. vkaryl
    Member
    Posted 8 years ago #

    Ooops - sorry, should have been a bit more exact!

  8. weejy
    Member
    Posted 8 years ago #

    Got it!
    That did the trick - you guys rock!

    Is there any way I can preface it with the text "posted by" or something to that effect?

    THANKS!

  9. vkaryl
    Member
    Posted 8 years ago #

    Yeah.... look for this:

    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> — <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit')); ?></div>

    Replace with this:

    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> — <?php the_author() ?> @ <?php the_time() ?> Posted by <?php edit_post_link(__('Edit')); ?></div>

  10. weejy
    Member
    Posted 8 years ago #

    Actually , I tried inserting the text before the <php> command an it works like a charm!

    Thanks for all the help. :)

  11. vkaryl
    Member
    Posted 8 years ago #

    Heh. Beat me to it, have fun!

Topic Closed

This topic has been closed to new replies.

About this Topic