How to customize Twenty Fourteen for Google Authorship

Several weeks ago, I wrote a post about how to customize Twenty Fourteen for Google Authorship. After that post, I updated the theme of this site to Twenty Fourteen.

So, here is what you need to write into your functions.php file in order to obtain the same result for Twenty Fourteen.

The change of the header is self-explanatory. Moreover, you need to add updated to the twentyfourteen_posted_on function.

[code language=”php”]<?php

add_action(‘wp_head’, ‘wpse_43672_wp_head’);
function wpse_43672_wp_head(){
?>
<link rel="author" href="https://plus.google.com/<your_Google_Id>/posts"/>
<?php
}

if ( ! function_exists( ‘twentyfourteen_posted_on’ ) ) :
/**
* Print HTML with meta information for the current post-date/time and author.
*
* @since Twenty Fourteen 1.0
*
* @return void
*/
function twentyfourteen_posted_on() {
if ( is_sticky() && is_home() && ! is_paged() ) {
echo ‘<span class="featured-post">’ . __( ‘Sticky’, ‘twentyfourteen’ ) . ‘</span>’;
}

// Set up and print post meta information.
printf( ‘<span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date updated" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>’,
esc_url( get_permalink() ),
esc_attr( get_the_date( ‘c’ ) ),
esc_html( get_the_date() ),
esc_url( get_author_posts_url( get_the_author_meta( ‘ID’ ) ) ),
get_the_author()
);
}
endif;

?>[/code]