• Hi all,

    Basically I have a news reel on my homepage which has a link to the articles author. Here’s my current code:

    <a href="https://www.mmamount.com/news/authors/<?php the_author(); php?>"><span class="main-byline">by <?php the_author(); ?></a></span>

    That does link, but not to the author, the only problem I’m having is the space between the authors first name and last name, it should be a ‘-‘ in the link,m but is rather a space.

    Any help is appreciated.

Viewing 1 replies (of 1 total)
  • Try this from the 2013 theme:

    <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
    <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentythirteen' ), get_the_author() ); ?>
    </a>

    Then go to your admin > users > edit > Choose, “Display publicly as” to choose who the Author’s name is displayed.

Viewing 1 replies (of 1 total)
  • The topic ‘Linking to an author’ is closed to new replies.