Hi there.
I’m trying to add a short line of text to appear at the end of every blog post. I tried adding the following to functions.php, but it broke the site:
add_filter('the_content','add_my_content');
function add_my_content($content) {
$my_custom_text = '<h5 style='font-weight:400; color:#dd5500; text-align:center;' class='mtm mbm'>CUSTOM TEXT HERE <a href="https://custom-url-here" title="link-title-here" target="_blank">FIND OUT WHY</a></h5>'; //
if(is_single() && !is_home()) {
$content .= $my_custom_text;
}
return $content;
}
Was I at least close?