WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Thirteen
Change author URL from archives page to Google+ profile (5 posts)

  1. Brandon
    Member
    Posted 5 months ago #

    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.

  2. esmi
    Forum Moderator
    Posted 5 months ago #

    Are you using a child theme?

  3. Brandon
    Member
    Posted 5 months ago #

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

  4. DMBarber
    Member
    Posted 5 months ago #

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

  5. Brandon
    Member
    Posted 5 months ago #

    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 );

Reply

You must log in to post.

About this Theme

About this Topic