I'm using the Unite theme in Wordpress with a child theme I have created.
When trying to remove an action the php error indicates that the functions.php file from the child theme is loading before the parent /inc/extras.php which contains the hook I want to override.
Trying to do everything correctly rather than just making the quick and dirty change in the parent theme.
Parent /inc/extras.php loaded from 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 I add remove to the same file it 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 I add to the child functions.php file it does not;
remove_action('woocommerce_before_main_content', 'unite_wrapper_start',10);
Child functions.php files is certainly loading and working...
Why would this be?