Google Authorship
-
How does google authorship sync with bbPress? Is the topic creator/question asker credited with authorship or the first responder?
For the site I’m planning to incorporate bb Press on, attributing to first responder would be helpful.
Thoughts, answers?
-
Does google authorship require a link to the persons google plus account? Or is that not the only way to do it?
Google authorship requires a piece of meta data (rel=author) on the published work that does sync back to the Google plus account.
Thoughts on whether bb press posts can be attributed to a given author for G Authorship purposes?
John
Right now bbPress doesn’t do anything with that.
It’s a good idea, but a plugin would need to be made to capture each users Google+ profile link (assuming there is one) and then put the stuff in the header as needed.
The following is what I use at AppGlobe:
/* Add Google+ profile URL as profile contact method */function appglobe_add_google_profile( $contactmethods ) {
$contactmethods['google_profile_url'] = ‘Google Profile URL’;
return $contactmethods;
}
add_filter( 'user_contactmethods', 'appglobe_add_google_profile', 10, 1);
/* Remove nofollow, and ad author to the profile link */function appglobe_switch_nofollow_for_author($str) {
$str = preg_replace(
‘~<a ([^>]*)\s*(["|\']{1}\w*)\s*nofollow([^>]*)>~U’,
‘<a ${1}${2}${3}>’, $str);
return str_replace(array(‘ rel=”"‘, ” rel=””), ‘rel=author’, $str);
}
add_filter( 'bbp_get_topic_author_link', 'appglobe_switch_nofollow_for_author' );And then in your user-profile.php (create a bbpress folder in your theme root, and copy it over) you can add this:
<?php if( bbp_get_displayed_user_field( 'google_profile_url' ) ) : ?><h2 class=”author-subtitle”>Google Profile</h2>
<?php if( bbp_get_user_role(bbp_get_displayed_user_id()) == ‘bbp_keymaster’ || bbp_get_user_role(bbp_get_displayed_user_id()) == ‘bbp_moderator’) : ?>
<a rel=”me” class=”bbp-user-url” href=”<?php esc_url(bbp_displayed_user_field( ‘google_profile_url’ )); ?>”><?php bbp_displayed_user_field( ‘google_profile_url’ ); ?>
</a>
<?php else : ?>
<a rel=”me nofollow” class=”bbp-user-url” href=”<?php esc_url(bbp_displayed_user_field( ‘google_profile_url’)); ?>”><?php bbp_displayed_user_field( ‘google_profile_url’); ?>
</a>
<?php endif; ?>
Since I beleave only the first rel=me link on a page counts there would be best to use topic lead:
add_filter( 'bbp_show_lead_topic', '__return_true' );…by doing so each page will be considered authored by the topic creator even if its paged.
That’s interesting, but not quite the approach he was asking about (from my understanding).
I think he was referring to the google rich snippets that show up if the page supports the appropriate meta (http://yoast.com/push-rel-author-head/)
You could use a good chunk of the code that is posted above (the part where it sets up a field for google+), then on topic pages get the topic user’s ID, and use that to put in the line above.
Yes thats what I’m referring to as well
. It doesn’t matter if you use meta links in the head section ( <link rel=”author” …) or content links such as <a rel=”author”.You can for example try my welcome topic at appglobe.com by searching google.com with the frase: appglobe.com welcome
…or you could try the google rich snippet tool for the welcome topic URL here: here
…but still there’s a problem with Google seeing only full pages as authored by an single author, not sections within a page( such as replies ), but they probably get to multi authored pages pretty soon
Of course the user has to add his G+ profile URL manually (so that the rel=”me” link points to his/her profile) for his picture to show up in SERPs, but having a rel=author in the links from topics or replies to his/her profile still makes sence.
If future versions of bbpress would start using more HTML5 each reply could be an <article/> element which would be more semantic for Google authorship.
But for now only one author for a page counts ( the first one ). Thats why I suggested using lead topics so that the topic creator get the authorship on paged topics.
Ah in that case, I think thats great. Since the author is the primary content creator of the thread, all things considering, I think it will work well.
You should considering polishing up that code and releasing it as a bbPress plugin on the WordPress.org plugin repository
You’d have to dynamically hook into the user edit page and maybe a few other changes, but the base of the work there is probably done.I think I will do that, but what do mean by dynamically hooking into the user edit page?
You must be logged in to reply to this topic.