i'm using unite theme in wordpress child theme have created.
when trying remove action php error indicates functions.php file child theme loading before parent /inc/extras.php contains hook want override.
trying correctly rather making quick , dirty change in parent theme.
parent /inc/extras.php loaded include in parent functions.php;
add_action('woocommerce_before_main_content', 'unite_wrapper_start', 10); add_action('woocommerce_after_main_content', 'unite_wrapper_end', 10); function unite_wrapper_start() { echo '<div id="primary" class="col-md-8">'; } function unite_wrapper_end() { echo '</div>'; }
when add remove same file works;
add_action('woocommerce_before_main_content', 'unite_wrapper_start', 10); add_action('woocommerce_after_main_content', 'unite_wrapper_end', 10); function unite_wrapper_start() { echo '<div id="primary" class="col-md-8">'; } function unite_wrapper_end() { echo '</div>'; } remove_action('woocommerce_before_main_content', 'unite_wrapper_start',10);
however, when add child functions.php file not;
remove_action('woocommerce_before_main_content', 'unite_wrapper_start',10);
child functions.php files loading , working...
why be?
add_action('init' , 'remove_functions' , 15 ); function remove_functions() { remove_action('woocommerce_before_main_content', 'unite_wrapper_start',10); } add_action('woocommerce_before_main_content', 'unite_wrapper_start1', 10); function unite_wrapper_start1(){ echo '<div id="primary" class="col-md-12">'; }
Comments
Post a Comment