Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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
    Colin

    #1487432

    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' );
    #1487452

    Hi Guenni007

    That is perfect. Thank you so much

    Much appreciated.

    Regards
    Colin

    #1487453

    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

    #1487494

    Hi

    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
    Colin

    • This reply was modified 1 month ago by waveseven.
    • This reply was modified 1 month ago by waveseven.
    #1487540

    Hi,

    Great! Glad to know that you managed to resolved the issue. Let us know if you have more questions. Have a nice day.

    Best regards,
    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Widget Area Abouve footer only on Woocommerce pages’ is closed to new replies.