Archived topic
Change Widget area widths
5 replies · Started by Tim on May 4, 2017
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';
}
Can you try adding a space between return and the number?
No luck
return '75';
return '25';
And save changes
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';
}
Tom, that did the trick, thanks
You're welcome :)