post

How to Highlight WordPress Authors in Search using the Genesis Framework

Get Authors Highlighted in Google Search with Genesis Framework

Based on the articles Highligting WordPress Authors and rel=”author” in WordPress both by Yoast, I have outlined the steps, below, on how to create a custom WordPress author page, specifically for the Genesis Framework from StudioPress, in order to highlight WordPress authors in search.

Highlight WordPress Authors

This article will cover steps for not only highlight WordPress authors in search using Google Plus, but also creating a custom author page for a Genesis child theme.

Creating a Custom WordPress Author Page and Highlight Authors

WordPress author page is already built into the Genesis Framework and its child themes.  You can access the author page by clicking on the author name, usually found at the beginning of each post.

A good looking custom WordPress author page is especially important if you have multiple blog authors and it is a great way to attract guest bloggers, particularly if you already have the capability to highlight WordPress authors for Google search results.

Below is how my WordPress author page (header part only) looked on trotterWay.com prior to customization: -

WordPress Author Page
Although, this is quite adequate I wanted to setup my author page and website so that: -

  1. it can be highlighted in the Google search results as explained here.
  2. I can add additional links such as Google Profile, Facebook, and Twitter.
  3. I can have the flexibility of altering the layout of the header part of the author page as well as the layout of posts and possibly add other relevant information as well in the future.

Step 1 – Create/Complete Google Plus Profile

Create a Google+ profile using this link, if you don’t already have one.  Make sure you: -

  1. Use a good head-shot photo image of yourself.
  2. Update your profile (on the About tab) as thoroughly as possible.
  3. On the About tab, there is Other Profiles section located on the right side of the page.   Add a link to your WordPress website author page.  The format of this URL should be http://yourdomain.com/author/authorid.  Author ID, in this case, should be the same as your WordPress Username.
  4. On the About tab Contributor To section, create entries (links) to websites / blogs to which you contribute.  Be sure to add your own website / blog.

Step 2 – Update WordPress Author Bio

Update your Bio on your WordPress website or blog as shown below.

WordPress Author Bio
You can get to the above screen via Users>Your Profile from your WordPress Dashboard.

Add some compelling information here about who you are and what you do. You can also add personal information here as well about your family and hobbies – just whatever you feel comfortable with.

Important: In the Bio, be sure to include a link to your Google + Profile with rel=author tag.  This can come after your have created your Bio info, and should be something like Connect with Nilesh on <a href=”https://plus.google.com/106206524274162168064?rel=author”>Google+</a>.  Be sure to use your own Google + Profile ID!

Step 3 – Enable Author Bio

In order to successfully create a WordPress author page, there are a couple of things that you need to do: -

  1. Make sure that “Disable the author archives” is unchecked on Yoast’s SEO for WordPress Plugin if you’re using it. If you aren’t using this plugin, I would highly recommend you start using it immediately (I’ll explain more in another post :) ).
    WordPress SEO Author Archive Setting
  2. On your own WordPress user profile (Users > Your Profile), under the Genesis User Settings, make sure that the “Enable Author Box on this User’s Archives?” is unchecked. Otherwise the standard header will appear on your WordPress author page.WordPress Author Archive Setting

Step 4 – Add Google+, Twitter, and Facebook Fields

Your current Contact Info on your profile should look something like: -

WordPress Profile Contact Info
We need to add fields for your Google Profile, Facebook, and Twitter, and any others you may want to add.

Add the following lines of code to your theme’s functions.php file or, better still, in your customs functions plugin (see Justin Tadlock’s article on why this is a great idea).

/* Add Custom Contact Profile Fields */

function tW_add_custom_contact_profilefields( $contactmethods ) {

    $contactmethods['google_profile'] = 'Google Profile URL';
    $contactmethods['facebook_id'] = 'Facebook ID';
    $contactmethods['twitter_id'] = 'Twitter UserName';
    unset($contactmethods['yim']);
    unset($contactmethods['aim']);
    unset($contactmethods['jabber']);

    return $contactmethods;
}
add_filter('user_contactmethods','tW_add_custom_contact_profilefields',10,1);

In the code above, I’m adding a field for Google Profile URL, Facebook, and Twitter. I decided I don’t want the standard AIM, Yahoo IM, and Jabber / Google Talk fields, so I’m actually removing them. If you want to keep these fields, then simply remove the appropriate lines.

The Google Profile URL is a complete URL to your Google Profile (see step 1 on how to setup).

For Facebook and Twitter, you just need to specify the IDs or Username and not the URL.

This is how your Contact Info Profile should look after you have modified your functions.php (or custom functions plugin). Don’t forget to refresh ;) .

WordPress Profile Contact Info

Step 5 – Create Custom Author Template

Create author.php file in the same directory as your child theme, and add the following code to it: -

<?php
/**
 *
 * Author template.
 *
 */

add_action( 'genesis_before_loop', 'tw_custom_auth_info' );

function tw_custom_auth_info() {

	if (is_author()) {
		$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));?>
		<div class="author-box"><?php echo get_avatar( $curauth->ID, $size = '76');?>
		<h1><?php echo $curauth->display_name;?></h1><p><?php
		echo $curauth->description;?></p><ul><?php

		$google_profile = get_the_author_meta( 'google_profile', $curauth->ID );
		$facebook_id = get_the_author_meta( 'facebook_id', $curauth->ID );
		$twitter_id = get_the_author_meta( 'twitter_id', $curauth->ID );

		/* Create Google Profile and Other Links */
		?><br/><?php
		if ( $google_profile ) {
			?><li class="gplus"><?php echo '<a href="' . $google_profile . '" rel="me">Google Profile</a>';?></li><?php
		}
		if ( $facebook_id ) {
			?><li class="facebook"><?php echo '<a href=http://www.facebook.com/' . $facebook_id . '>Facebook</a>';?></li><?php
		}
		if ( $twitter_id ) {
			?><li class="tweet"><?php echo '<a href=http://twitter.com/intent/user?screen_name=' . $twitter_id . '>Twitter</a>';?></li><?php
		}
		?></ul></div><?php

	}
}

genesis(); // <- everything important: make sure to include this.
?>

I decided to leave the existing styling in place but it can be easily changed to fit your theme look-and-feel. See WordPress Author Templates for more details on adding additional Bio/User information.

Now my custom WordPress author page looks like: -

highlight wordpress authors
Although not too much different, notice the three new links. I can also pull in more information from the User Profile and add it programmatically if I want to in the future.

Step 6 – Complete Authorship Request Form

This is an important step, one that many people omit, myself included.

Complete Google’s Authorship Request form.

Step 7 – Test (and Wait…)

Check that your implementation of custom author page with Google search highlighting capability is correct by using the Rich Snippets Tool provided by Google.

This is how you can highlight WordPress authors in search results.  Let me know if you find this article useful and/or if you have any questions.


Signup to receive more quality articles, tips, and tricks for WordPress and the Genesis Framework.

About Nilesh Peshawaria

Software developer by trade, and more recently Entrepreneur. Proficient Wordpress Genesis Framework systems architect, website strategist, and affiliate marketer.
Connect with Nilesh on Google+

Comments

  1. Melinda says:

    TY!! This is exactly what I was looking for. I was having trouble getting it to work in Genesis.

  2. Clare says:

    Brilliant! But what if I want to like to an image rather than have the link as text? I can’t figure out how to insert the image code into the PHP :(

    • Clare,

      I’m assuming that you want images on the Google/FB/Twitter links on yourdomain.com/author page… If so, you can do it a couple of ways: -

      1/ Just replace the anchor text e.g. Google Profile / FB /Twitter with the image tag i.e.

      <img src="location of your image..." />

      2/ I prefer this way. Modify your style sheet to add something like: -

      .gplus {
      background: url(images/plus-icon.png);
      background-repeat: no-repeat;
      background-position: left center;
      padding-left: 20px;
      }
      

      The image has to be in the themes image folder.

      Then, in author.php, add the div tag with class of gplus: -

      <a href="' . $google_profile . '" rel="nofollow"><div class="gplus">Google Profile</div></a>

      Then do the same for Facebook and Twitter.

      In either case, you will have the images. You will have to alter the layout, perhaps remove the list tags.

      Hope this helps!

  3. Mark Homer says:

    This is great. I wanted to see how to modify the author page in genesis. Also want to add in LinkedIn and with your examples that will be very easy to do too. Glad you answered Clare’s question on the styling of the images. I had the same question. I like your stylesheet solution. We guest blog on other sites so this will be great to have all setup when we use rel=me on those sites. THANKS!

  4. LiveRobin says:

    if you see problogger in google search then you might see author image larger than our author image in google search. How to achieve this? any idea?

  5. This is what I really want, really helpful article. Last step to highlight WordPress Authors in Search, their is form, don’t forget to fill up the form so Google know about you have implemented the authorship.

  6. Gusto says:

    I did the RichSnippets test and got the following error:
    Error: Author profile page does not have a rel=”me” link to a Google Profile

    Any ideas? Thanks.

    • Hey Gusto, make sure your content is linked to your Google Profile and vice versa. I updated a couple of items in the article to clarify the process a little more, so please be sure to review.

  7. Ben says:

    Hi Nilesh,

    Great guide! Looks like I got it all set up. Quick question though..in my author box, it’s still showing the default Genesis/Wordpress avatar. Once Google picks things up, will it eventually start using my image from my Google+ profile instead?

    • Ben, glad you found the article useful, thanks for commenting! The image in WordPress Author Bio is whatever you have setup at Gravatar.com – Google (Profiles) will not update this. I have the same image on Gravatar as well as Google Profiles.

  8. Colin says:

    Great info! Thanks for laying it down in a step by step fashion!

  9. Thank you, thank you, thank you! After 3 hours and 4 different “how to’s” I think your instructions got me where I needed to go with no errors and my photo showing up on the Rich Snippets Testing Tool page! So happy!

Trackbacks

  1. Hello world! says:

    [...] Author Box follow this guide. Filed Under: News · About [...]

Share Your Thoughts

*