1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to enable the authors link in each post?

Discussion in 'WordPress' started by mtsandeep, Oct 2, 2008.

  1. #1
    I am building a new wordpress blog, My blog posts doesn't show the author link.
    How to put a link to author profile page? I want to allow some authors to post in my blog. please help me
     
    mtsandeep, Oct 2, 2008 IP
  2. craiger22

    craiger22 Well-Known Member

    Messages:
    1,472
    Likes Received:
    99
    Best Answers:
    0
    Trophy Points:
    170
    #2
    Just add the following code where you want it to be displayed within the loop:
    <?php _e('By','options'); ?> <?php the_author_posts_link(); ?>
    Code (markup):
    This will return - By <AUTHOR PROFILE LINK>
     
    craiger22, Oct 2, 2008 IP
    Dean_Saliba likes this.
  3. mtsandeep

    mtsandeep Active Member

    Messages:
    218
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #3
    but where should i put the code, Which file i need to edit?
    thanks
     
    mtsandeep, Oct 4, 2008 IP
  4. craiger22

    craiger22 Well-Known Member

    Messages:
    1,472
    Likes Received:
    99
    Best Answers:
    0
    Trophy Points:
    170
    #4
    Well, if you want it on your main index page simply edit your template file home.php

    Place the code anywhere after this code:

    <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
    Code (markup):
    but before this:

    <?php endif; ?>
    Code (markup):
    This bit is called the "loop."

    To place the author on your single posts, edit your single post template "post.php"

    The code works anywhere within the loop but where you put it really depends on where you want it shown. I hope this has given you enough information to continue.
     
    craiger22, Oct 4, 2008 IP
  5. mtsandeep

    mtsandeep Active Member

    Messages:
    218
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #5
    My blog will be having multiple authors. So where should i put the code?
    i want their name to be linked to their respective profile.
     
    mtsandeep, Oct 4, 2008 IP
  6. mtsandeep

    mtsandeep Active Member

    Messages:
    218
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #6
    OK, i have made it, whats this "<?php _e('By','options'); ?>" means?
     
    mtsandeep, Oct 4, 2008 IP
  7. Dean_Saliba

    Dean_Saliba Notable Member

    Messages:
    1,198
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    225
    #7
    Thank you for this, I have been looking to get this solution for a while.

    Rep added. :)
     
    Dean_Saliba, Oct 5, 2008 IP