Well, Google Plus is not intuitive at all. And the instructions are disconnected. Each step maybe described well, but the whole process - go and figure it out on your own.
So here is what we did to enable Google "authorship" feature so that our blog posts appear on Google search results like this:
Create a Google+ Profile and Link it with Your Blog
- First, you need to create your own personal profile with Google Plus. For that, you need to verify your email with Google.
- Then you need to add a business page with your company profile and link your business page with your own personal profile. Follow Google's instructions on that. They are not very clear, but after a few pokes around, you will get it.
- Google would want to verify your business and will send you a post card wtih a PIN number that you would need to enter into your business profile. Remember to view the pages as "yourself" or else you won't be able to edit any business info. The post card takes 2 weeks to arrive.
- Then you need to confirm yourself as an author of your site with Google: https://plus.google.com/authorship
- And now to get Google to identify a page as written by you, what it needs to see in a page is the following code:
<a rel="author" href="/<your G+ profile link>">John Smith</a>
For K2 articles; if you selected the option to 'show Author', it already creates the following:
<a rel="author" href="/<link to K2 user page>">John Smith</a>
- To make it show the G+ profile link, go to K2 > Users and add the profile link as the user URL. Then, go into component/com_k2/templates/blog/item.php and component.com_k2/templates/default/item.php
Find under <!-- Item Author --> the following code
echo $this->item->author->link;
and replace it with (save copies!)
echo $this->item->author->profile->url;
- For Joomla article, the following plugin should help:
http://duben.org/joomla-english/sd-google-authorship-plugin-for-joomla or this: http://www.deconf.com/en/projects/how-to-set-up-google-authorship-markup-with-rel=author-in-joomla/
- For those who like to use the code, it gets a little tricky to describe, as each template might have created its own version of the article display, and different version of Joomla also might have different display methods. In general, try to find in:
templates/<your template>/html/com_content/article/default.php (if not found, copy from components/com_content/views/article/tmpl/default.php)
-
Find where it generates the author text (usually with a class called createdby or create_by), and replace it with the following:
<?php
//name of K2 user table
$query = 'SELECT url FROM #__k2_users WHERE userID=' . $this->article->created_by;
$db =& JFactory::getDBO();
$db->setQuery($query);
$authorlink = $db->loadResult();
?>This gives the variable $authorlink your Google Profile URL that you saved in K2 in the steps above.
- Now change the author link to something along these lines:
<a rel="author" href="/<?php echo $authorlink; ?>"><span class="createby">
<?php some code from Joomla that shows the author name ?></a>
</span></a>That should make authorship works on Joomla default articles too.
- Finally, test on http://www.google.com/webmasters/tools/richsnippets that you have authorship successfully linked.
Hope this works for you!
It takes a few days for Google to reindex your pages and start showing your "authorship".