-
-
Save laranz/42b240ca0ba9e085445d6910a3b4a689 to your computer and use it in GitHub Desktop.
This file contains 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
// auto insert hidden hatom data in single posts | |
add_filter('the_content', 'hatom_data_in_content', 100); | |
function hatom_data_in_content($content) { | |
if (is_single()) $content .= get_hatom_data(); | |
return $content; | |
} | |
// returns hidden hatom data for current post | |
function get_hatom_data() { | |
$html = '<div class="hatom-extra" style="display:none;visibility:hidden;">'; | |
$html .= '<span class="entry-title">'.get_the_title().'</span>'; | |
$html .= '<span class="updated"> '.get_the_modified_time('F jS, Y').'</span>'; | |
$html .= '<span class="author vcard"><span class="fn">'.get_the_author().'</span></span></div>'; | |
return $html; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment