Created
December 31, 2014 16:18
-
-
Save nickcernis/c74093666b6906a1fa67 to your computer and use it in GitHub Desktop.
Add author and updated hatom data to posts and pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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