Support » Fixing WordPress » How to make the name of the author display

Viewing 10 replies - 1 through 10 (of 10 total)
  • Just add this php code to your template to display the post authors name:

    <?php the_author(); ?>

    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

    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.

    Sorry – I forgot to mention I’m running 2.02
    My index.php file just says “short and sweet” and “require header”.

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

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

    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!

    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>

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

    Thanks for all the help. 🙂

    Heh. Beat me to it, have fun!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to make the name of the author display’ is closed to new replies.