Hello,
I would like to add a function.php to my child theme. But I get a syntax error.
So I hope you can tell me where I’m doing something wrong. I really don’t know much about php. When I add the code at the bottom of the function.php of the theme I works fine. But when I try to make a function.php for the child theme I get the syntax error.
I hope you can help me.
Kind regards,
Birgitta
This is the code I added to the child theme function.php:
<?php
/**
* interface-child: adding hatom data
*/
//mod content
function hatom_mod_post_content ($content) {
if ( in_the_loop() && !is_page() ) {
$content = ‘<span class=”entry-content”>’.$content.'</span>’;
}
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()) {
$content .= ‘<div class=”hatom-extra”><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’, ‘add_mod_hatom_data’);
}
?>