Forums

[resolved] How to add a "Posted by Admin" (Authors) to wordpress posts (11 posts)

  1. reefy
    Member
    Posted 2 years ago #

    Hi there

    I have the RedLight theme installed on my wordpress blog.

    On each post i publish id like to have a "Posted by Admin" (Or my authors names) after each post before the date and tags.

    Is there any peice of code that i can add so i can do this. If there is could someone help me thankyou.

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    posted by <?php the_author() ;>

    is the code that will make the author of a post show up. Pop it in place before posted on <?php the_time('F j,y') ?> in index.php

    (your time code may look slightly different than that)

  3. reefy
    Member
    Posted 2 years ago #

    Thank you so much RVoodoo

    I'll give it ago and report back, thanks for your swift response.

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    for sure! Depending on your theme, it may be as simple as adding that code....or you may find you need to style it a bit with css.... sometimes things gotta be tweaked a bit....

  5. MichaelH
    Volunteer
    Posted 2 years ago #

    Just as a note, if you this you get a link to that author's posts:
    posted by <?php the_author_post_link() ;>

  6. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    posted by <?php the_author_posts_link() ;>

    think we forgot an 's' in that?

    (hmm....I'd never played around with that as I'm the only author on my site....but neither way works for me..... one gives undefined function error, the other gives me a blank page. I must be doing something dumb here...)

  7. reefy
    Member
    Posted 2 years ago #

    Thanks for the input guys, i will try it out and report back soon.

    Cheers :)

  8. MichaelH
    Volunteer
    Posted 2 years ago #

    yep missing the 's' thanks RVoodoo. Wish they used that in the WordPress Default theme.

  9. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    to the OP....
    I forgot a ? in my code
    posted by <?php the_author(); ?>
    or
    posted by <?php the_author_posts_link(); ?>

    is proper...sorry 'bout that

    (stupid early morning.......) ;)

  10. reefy
    Member
    Posted 2 years ago #

    RVoodoo & MichaelH

    Thanks guys! It works wahooo :)

    Stars both of you, cheers :)

  11. Rev. Voodoo
    Volunteer Moderator
    Posted 2 years ago #

    very good!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags