Add itemprop=”creator” Microdata to Comment Author Link in WordPress

This wraps the comment author link with itemprop=”creator” microdata. It will be wrapped correctly with itemprop=”creator”, and itemscope itemtype=’http://schema.org/Person, then itemprop=’name’. This goes in your functions.php. This will apply to the comment author on each comment in your WordPress blog.

/**
 * add itemprop=creator microdata to comments author
 * original $author_link = "<a href='$url' rel='external nofollow' class='url'>$author</a>";
 */
function isa_comment_author_link($author_link) {
	global $post;
	$author = get_comment_author();
	return "<span itemprop='creator' itemscope itemtype='http://schema.org/Person'><span itemprop='name'>$author</span></span>";
}
add_filter('get_comment_author_link', 'isa_comment_author_link');

See more: ,

Questions and Comments are Welcome

Your email address will not be published. All comments will be moderated.

Please wrap code in "code" bracket tags like this:

[code]

YOUR CODE HERE 

[/code]