Function snippet not working to disable footer widgets in woocommerce pages
-
Hello,
I run a woocommerce website with a genesis framework theme. The theme has Widgets I’d like to disable in the woocommerce related pages. I’m trying this snippet:
if ( function_exists( 'is_woocommerce' ) ) { add_action( 'genesis_before_footer', 'remove_footer_woo' ); function remove_footer_woo() { if ( is_shop() || is_page( 'support' ) || 'product' == get_post_type() || is_woocommerce() ) { remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' ); remove_action('genesis_footer', 'genesis_do_footer'); remove_action('genesis_footer', 'genesis_footer_markup_open', 5 ); remove_action('genesis_footer', 'genesis_footer_markup_close', 15 ); }}}
The above code worked for a while and then all of a sudden the widgets started appearing again. I thought maybe it had something to do with the priorities so experimented with that, but now no matter what I do the code doesn’t work at all when used in my functions.php
I’ve even tried specifically targeting one of the widgets:
add_action( 'genesis_before_footer', 'remove_footer_cta' ); function remove_footer_cta() { if ( is_woocommerce() ) { remove_action( 'genesis_before_footer', 'essence_footer_cta', 17 ); } }
But nothing. I’m not sure why this wouldn’t work even after having worked before (on and off). What could be causing this behavior?
Warmly,
Matt
- The topic ‘Function snippet not working to disable footer widgets in woocommerce pages’ is closed to new replies.