
-
AuthorPosts
-
July 31, 2025 at 3:47 pm #1487423
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
ColinJuly 31, 2025 at 9:52 pm #1487432by 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' );
August 1, 2025 at 10:10 am #1487452Hi Guenni007
That is perfect. Thank you so much
Much appreciated.
Regards
ColinAugust 1, 2025 at 10:38 am #1487453Just 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 GETTINGRegards
ColinAugust 2, 2025 at 2:48 pm #1487494Hi
I’ve managed to do it by taking abit of code from one and a bit from the other and also added a div in the code.
This seems to work nicely now.
/************************************************ * ADD PARALLAX TO WOOCOMMERCE PAGES ************************************************/ add_action('ava_before_footer', function () { if ( class_exists( 'WooCommerce' ) && ( is_woocommerce() ) ) { echo do_shortcode(" <div>[av_sidebar widget_area='Shop-Widget']</div>"); } }, 10);
it appeared on the single page though so I had to add
.single .av-section-cont-open, .single .av-parallax-section { display: none !important; }
Thanks for your help
Regards
ColinAugust 4, 2025 at 7:10 am #1487540 -
AuthorPosts
- The topic ‘Widget Area Abouve footer only on Woocommerce pages’ is closed to new replies.