- This topic has 9 replies, 3 voices, and was last updated 8 years, 7 months ago by Tom.
-
AuthorPosts
-
June 12, 2015 at 3:55 am #114130David Harper
Hi tom,
I was wondering if the Footer Widgets 0-5 could be manipulated so that I could each widget a specific width?
So for example instead of having 3 widgets by default/Global setting; I could use 2 footer widgets where the width of 1 is two-thirds of the footer width and the remaining widget spans the last one-third?
Or If I wanted the default setting of 3 footer widgets inline and a possible 4th the 3 default widgets that, again spans the full width of the footer section.
Here’s two examples if my explanation wasn’t clear enough: http://i.imgur.com/pBHBGwK.png?1
Cheers.
June 12, 2015 at 9:00 am #114157TomLead DeveloperLead DeveloperAbsolutely! Each widget has a filter for the width.
For example:
add_filter( 'generate_footer_widget_1_width','generate_custom_footer_widget_1_width' ); function generate_custom_footer_widget_1_width() { // 25% return '25'; } add_filter( 'generate_footer_widget_2_width','generate_custom_footer_widget_2_width' ); function generate_custom_footer_widget_2_width() { // 20% return '20'; } add_filter( 'generate_footer_widget_3_width','generate_custom_footer_widget_3_width' ); function generate_custom_footer_widget_3_width() { // 15% return '15'; } add_filter( 'generate_footer_widget_4_width','generate_custom_footer_widget_4_width' ); function generate_custom_footer_widget_4_width() { // 20% return '20'; } add_filter( 'generate_footer_widget_5_width','generate_custom_footer_widget_5_width' ); function generate_custom_footer_widget_5_width() { // 20% return '20'; }
Typically, you want them to add up to 100%, but I’m sure you could do some cool stuff like your second example ๐
June 12, 2015 at 9:03 am #114159David HarperCheers Tom,
much appreciated bud.June 12, 2015 at 9:04 am #114160TomLead DeveloperLead DeveloperHappy to help ๐
August 12, 2015 at 9:13 am #128654sangam krwhere to add the Each widget filter for the width in the theme. Is it in custom CSS or to create a child theme and change it or edit the footer widget php.
August 12, 2015 at 9:34 am #128668TomLead DeveloperLead DeveloperThis should help: https://generatepress.com/knowledgebase/adding-php-functions/
August 20, 2015 at 12:38 pm #130931Mike AllenSorry to revive this old thread but I just want to clarify: If I wanted to make my footer widget spaces stay in a single row on a smaller screen, I could paste that PHP you provided into the Code Snippets Plugin window, adjust the percentages to whatever I liked (that added to 100), and save and refresh?
Furthermore, I currently only have three footer spaces, but would like to be able to easily add more in the future. Could I just comment out the code for spaces four and five like so:
*/ this is the code for footer spaces four and five */
?I’m afraid of crashing my site and spending a lot of time trying to fix it later is why I’m asking rather than just trying.
August 20, 2015 at 3:27 pm #130971TomLead DeveloperLead DeveloperHi Mike,
So you don’t want your footer widgets to stack on top of each other on mobile? It might be super squished if you force them to be next to each other?
You can add up to 5 footer widgets in the Customizer inside the “Layout” section: https://generatepress.com/knowledgebase/choosing-footer-widgets/
August 20, 2015 at 9:11 pm #131007Mike AllenHi Tom,
Not necessarily on a mobile screen. But even on my 13″ screen, if I have the browser window any less than edge to edge, one container goes to the bottom, leaving an unsightly empty space to its right. I’d just like to reduce the amount of space that each container takes up, because it seems unreasonably large. I’ve adjusted the spacing down to 5px top and bottom, and 0px left and right in the element spacing>footer and footer widgets areas, and there’s still way more blank space than I’m used to seeing in a footer box. I was hoping this was the solution.
Mostly, I love the theme. Thanks.
August 21, 2015 at 12:15 am #131014TomLead DeveloperLead DeveloperHmm, I can’t think of what the issue looks like – any chance you can share a link so I can see?
-
AuthorPosts
- You must be logged in to reply to this topic.