Skip to content

Instantly share code, notes, and snippets.

Created July 26, 2014 09:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Lösung für RichSnippets in dem Theme Twenty Thirteen von Wordpress. Gehört zu dem Kommentar von Janet ( des Beitrages
//mod content
function hatom_mod_post_content ($content) {
if ( in_the_loop() && !is_page() ) {
$content = '’.$content.”;
return $content;
add_filter( ‘the_content’, ‘hatom_mod_post_content’);
//add hatom data
function add_mod_hatom_data($content) {
$t = get_the_modified_time(‘F jS, Y’);
$author = get_the_author();
$title = get_the_title();
if ( is_single() || is_page()) {
$content .= ”.$title.’ was last modified: ‘.$t.’ by ‘.$author.”;
return $content;
add_filter(‘the_content’, ‘add_mod_hatom_data’);
Da ich nicht möchte, dass auf jeder Seite der Autor und das Aktualisierungsdatum steht, habe ich in die style.css des Child-Theme’s eingefügt:
/* Google rich snippets: alternative style to hide sentence from view */
.hatom-extra {display: none;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment