WordPress.org

Support

Support » Themes and Templates » Change author URL from archives page to Google profile

Change author URL from archives page to Google profile

  • My goal: Display the author meta link inline with the other post meta (date, category, tags) and have it link out to a user’s google+ profile, rather than to the author archives page.

    Details: My author archives page is currently deactivated via the SEO for WordPress plugin by yoast. I have found a way to display the author link inline with the other post meta data by placing the below code into my child theme stylesheet:

    .single-author .entry-meta .author {
    	display: inline;
    }

    Currently it is set to display none as I do not want to display it until I figure out the rest of the puzzle.

    My question: What changes do I need to make to either the author.php, or author-bio.php (or other files) to accomplish my goal of having the author meta listing on a post link out to the google+ profile of the user (ideally pulled from the user profile rather than hard coding a link)

    My site: brandonmarkwalder.com

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    @esmi

    Forum Moderator

    Are you using a child theme?

    Yep. My child theme contains my style sheet and various other templates I have made changes to.

    It sounds like you have already made a great start. Have you read through this page about Author Templates in the codex?

    Thanks DMBarber. I’m figuring all of this out as I go, so the codex is often just as ‘Greek’ as it is helpful to me. I do take my time with it in the effort of learning and figuring things out. From staring at the codex, and the author and author-bio files, I came to the conclusion that they were not where I should be working to solve this problem.

    I will keep working on a more elegant solution but for the time being, the below code from one of Yoast’s articles gets the job done once dropped into my functions.php in my child theme:

    function change_author_link( $link, $author_id, $author ) {
      if ( 'MYAUTHORNAME' == $author )
        return 'https://plus.google.com/MYGOOGLEPLUSPROFILE';
      return $link;
    }
    add_filter( 'author_link', 'change_author_link', 10, 3 );

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Change author URL from archives page to Google profile’ is closed to new replies.