wordpress - PHP function missing bracket? Crashes page -
i'm using woocommerce in wordpress , trying add 2 pieces of code documentation functions.php file
see here 2 pieces of code want add.
i added first file , worked great. add second 1 , entire site smashes, assume because functions.php file vital , there syntax error... can't spot it, , documentation comes site!
this have added:
add_filter( 'add_to_cart_text', 'woo_custom_cart_button_text' ); function woo_custom_cart_button_text() { return __( 'add basket', 'woocommerce' ); } add_filter('single_add_to_cart_text', 'woo_custom_cart_button_text'); function woo_custom_cart_button_text() { return __('add basket', 'woocommerce'); }
you can see full file here see them in context, starts line 61.
can see why adding these 2 functions might causing entire site smash? seems weird adding 1 fine add 2 , breaks file.
maybe not error coming from, think added same function twice:
function woo_custom_cart_button_text() { return __('add basket', 'woocommerce'); }
you're getting fatal cannot redeclare function
error causes script halt.
Comments
Post a Comment