Function.php not working in child theme

Hello,

i’m trying to add code in function.php in the child theme but it doesn’t work. when i add the same code in the pro theme it work…

The child theme is activated.

Thanks for your help.

Hello Luca,

I tried to login to your site but there codes you have added to the functions.php of the child theme is inaccessible through the backend’s Theme Editor.

Would you mind posting the code you are trying to add so that we can check?

Thank you.

Thanks for you reply,

here is the code :

add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );

Hi Luca,

Please activate the child theme then update the code that you have to:

function custom_woocommerce_hooks() {
	add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
}

add_action( 'init', 'custom_woocommerce_hooks' );

Hope this helps.

Thanks it works :slight_smile:

You’re very welcome, Luca.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.