Site logo

Archived topic

footer alignment

1 reply · Started by Anonymous on March 21, 2016

Viewing posts 1–2 of 2

I am using three footer widgets and have managed to get them aligned how I want using some php code I found on the website:

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

add_filter( 'generate_footer_widget_2_width','generate_custom_footer_widget_2_width' );
function generate_custom_footer_widget_2_width()
{
      
      return '45';
}

add_filter( 'generate_footer_widget_3_width','generate_custom_footer_widget_3_width' );
function generate_custom_footer_widget_3_width()
{
  
      return '20';
}  

This looks fine on the laptop and mobile but on tablet there are two widgets on one row and the third widget on another row. How can it be changed so the widgets squish together on a tablet screen?

You'll want to set the tablet widths as well, for example: generate_footer_widget_1_tablet_width

So your code would be:

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

add_filter( 'generate_footer_widget_2_width','generate_custom_footer_widget_2_width' );
add_filter( 'generate_footer_widget_2_tablet_width','generate_custom_footer_widget_2_width' );
function generate_custom_footer_widget_2_width()
{
      
      return '45';
}

add_filter( 'generate_footer_widget_3_width','generate_custom_footer_widget_3_width' );
add_filter( 'generate_footer_widget_3_tablet_width','generate_custom_footer_widget_3_width' );
function generate_custom_footer_widget_3_width()
{
  
      return '20';
}

Hope this helps :)

This archived topic is closed to new replies.