I've been messing around with child themes in Wordpress and while I know how to add or change code from the parent theme I'm having a bit of a problem removing certain code. For example I'm using a theme that uses featured images for thumbnails in posts. I want the added picture for the thumbnail but it also includes it at the top of the actual post which I am trying to remove. I can comment out part of the code to achieve this in the parent functions.php like this
if (!function_exists('mh_featured_image')) {
function mh_featured_image() {
global $post;
if (has_post_thumbnail() && !is_attachment()) {
$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'content');
// echo "
" . '<div class="post-thumbnail">' . "
";
// echo '<img src="' . esc_url($thumbnail[0]) . '" alt="' . esc_attr(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) . '" title="' . esc_attr(get_post(get_post_thumbnail_id())->post_title) . '" />' . "
";
// if (get_post(get_post_thumbnail_id())->post_excerpt) {
// echo '<span class="wp-caption-text">' . esc_attr(get_post(get_post_thumbnail_id())->post_excerpt) . '</span>' . "
";
// }
// echo '</div>' . "
";
}
}
}
So when I comment out the actual code out in the parent functions.php as shown above everything works perfectly. My issue is how do I translate this to the child functions.php? I just want to keep everything but edit out those six lines that are echoed.