Site logo

Archived topic

Footer widget widths

3 replies · Started by David on May 20, 2019

Viewing posts 1–4 of 4

Hi there,

I am using the code below to adjust footer widget widths (code from somewhere here I think!)
And it works fine - it is being used on 7 product category pages.
But one page does not require the first widget, but I can't turn it off, as there is some code in the widget to display Woo Products in the right widget.
So I need to know how to make the following 0 for footer_widget_1 and 100 for footer_widget_2 but just for one page?
Page is linked below, you can see the 11 products with a blank left widget!
TIA, Dave


add_filter('generate_footer_widget_1_width','tu_custom_footer_1_width');
function tu_custom_footer_1_width(){
    return'35';
}

add_filter('generate_footer_widget_2_width','tu_custom_footer_2_width');
function tu_custom_footer_2_width(){
    return'65';
}

Hi there,

Give this CSS a shot:

body.page-id-15260 .footer-widget-1 {
    display: none;
}
@media (min-width: 1025px) {
    body.page-id-15260 .footer-widget-2.grid-65 {
        width: 100%;
    }
}

Adding CSS: https://docs.generatepress.com/article/adding-css/

Let me know :)

Perfect, thanks Leo!

No problem :)

This archived topic is closed to new replies.