Make Adjustment to functions.php in child theme
-
In the parent functions.php
is this code:function woocommerce_template_loop_product_thumbnail() { printf( '<span class="et_shop_image">%1$s<span class="et_overlay"></span></span>', woocommerce_get_product_thumbnail() ); }
I don’t want to mess with my parent files so have managed to create this code and make it work when placed in the functions.php of my child theme.
function woocommerce_template_loop_product_thumbnail() { printf( '<span class="et_shop_image">%1$s<span class="et_overlay"><span class="shop_caption"><h6>%2$s</h6></span><p class="info">READ MORE</p></span></span>', woocommerce_get_product_thumbnail(), ( get_post_thumbnail_caption() ) ); }
The problem:
The child theme code only works if I remove the noted parent theme code. When I keep both pieces of code it breaks the site.
Note: I’m on a localhost so can’t share a link.Question:
Is there a way to make my child theme code work without having to mess with my parent theme file?Thanks for your help
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Make Adjustment to functions.php in child theme’ is closed to new replies.