Skip to content

Instantly share code, notes, and snippets.

@nickcernis
Created December 31, 2014 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickcernis/c74093666b6906a1fa67 to your computer and use it in GitHub Desktop.
Save nickcernis/c74093666b6906a1fa67 to your computer and use it in GitHub Desktop.
Add author and updated hatom data to posts and pages
<?php
//Add hAtom data to all posts and pages
function sp_hatom_data($content) {
$t = get_the_modified_time('F jS, Y');
$author = get_the_author();
$title = get_the_title();
$content .= '<div class="hatom-extra" style="display:none;visibility:hidden;"><span class="entry-title">'.$title.'</span> was last modified: <span class="updated"> '.$t.'</span> by <span class="author vcard"><span class="fn">'.$author.'</span></span></div>';
return $content;
}
add_filter('the_content', 'sp_hatom_data');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment