Hi
I know how to add a widget area above the footer for all page with
/************************************************
* DISPLAY WDGET ABOVE FOOTER
************************************************/
add_action('ava_before_footer','avia_above_footer');
function avia_above_footer(){
dynamic_sidebar( 'footer-widget' );
}
}
but is there a similar bit of code to only add a widget to the footer of Woocommerce pages, particularly category grid pages?
Many Thanks
Regards
Colin
by the way there is one obsolete curly bracket in your snippet!
try instead:
(if you do not need it on checkout page etc. – adjust the conditionals)
function widget_area_above_footer_woocommerce() {
// Check if we are on a WooCommerce page.
if ( class_exists( 'WooCommerce' ) && ( is_woocommerce() || is_cart() || is_checkout() || is_account_page() ) ) {
// If it's a WooCommerce page, display the widget area.
dynamic_sidebar( 'footer-widget' );
}
}
add_action( 'ava_before_footer', 'widget_area_above_footer_woocommerce' );
Hi Guenni007
That is perfect. Thank you so much
Much appreciated.
Regards
Colin
Just tried it and it sort of works ok. I am trying to get a parallax banner at the bottom of the woocommerce page but when i paste in the code it seems to put the footer and socket inside the widget.
attached is a picture of what I want to achieve and a picture of what is happening. Do you know how I can fix this please?
WHAT I WANT TO ACHIEVE
WHAT I AM GETTING
Regards
Colin