[Resolved] Change Widget area widths

Home Forums Support [Resolved] Change Widget area widths

Home Forums Support Change Widget area widths

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #314048
    Tim

    Hello,

    I got the code from Here
    https://docs.generatepress.com/article/footer-widgets/

    I have two widget areas The 1st want to be 75%, the 2nd 25%

    I saved and activated code snippet and something happened, widget areas no longer aligning

    http://greaterthanthesum.com/blog/

    Thanks

    add_filter('generate_footer_widget_1_width','tu_custom_footer_1_width');
    function tu_custom_footer_1_width(){
        // Return the percentage of this widget width - 25% in this case
        return'75';
    }
    
    add_filter('generate_footer_widget_2_width','tu_custom_footer2_width');
    function tu_custom_footer_2_width(){
        // Return the percentage of this widget width - 75% in this case
        return'25';
    }
    #314159
    Tom
    Lead Developer
    Lead Developer

    Can you try adding a space between return and the number?

    #314160
    Tim

    No luck
    return '75';
    return '25';

    And save changes

    #314163
    Tom
    Lead Developer
    Lead Developer

    Ah, your function name and action call aren’t matching.

    This is what it should be:

    add_filter('generate_footer_widget_1_width','tu_custom_footer_1_width');
    function tu_custom_footer_1_width(){
        // Return the percentage of this widget width - 25% in this case
        return '75';
    }
    
    add_filter('generate_footer_widget_2_width','tu_custom_footer_2_width');
    function tu_custom_footer_2_width(){
        // Return the percentage of this widget width - 75% in this case
        return '25';
    }
    #314164
    Tim

    Tom, that did the trick, thanks

    #314165
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.