Black Friday Sale! Get up to $40 off GP Premium!Learn more

footer alignment

Home Forums Support footer alignment

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #180752
    kev

    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?

    #180818
    Tom
    Lead Developer
    Lead Developer

    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 🙂

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