• Resolved Sevar

    (@sevar)


    Hi!

    I want to add two equal footer widget areas below the three defaults footer widget area. I saw the post about the fourth widget area on the theme site, it’s like this:

    // Adds a widget area. It gets registered automatically as part of the arra
    add_filter( 'tc_footer_widgets', 'my_footer_widgets');
    function my_footer_widgets( $default_widgets_area ) {
        $default_widgets_area['footer_four'] = array(
              'name'                 => __( 'Footer Widget Area Four' , 'customizr' ),
              'description'          => __( 'Just use it as you want !' , 'customizr' )
        );
        return $default_widgets_area;
    }
    
    // Adds a class to style footer widgets
    add_filter( 'footer_four_widget_class', 'my_footer_widget_class');
    function my_footer_widget_class() {
        return 'span12';
    }

    but how to alter it for it to be the two areas?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi Sevar,

    Firstly add a fifth widget area. Add this code to your child theme’s functions.php

    add_filter( 'tc_footer_widgets', 'my_footer_widgets');
    function my_footer_widgets( $default_widgets_area ) {
        $default_widgets_area['footer_four'] = array(
              'name'                 => __( 'Footer Widget Area Four' , 'customizr' ),
              'description'          => __( 'Just use it as you want !' , 'customizr' )
        );
    	  $default_widgets_area['footer_five'] = array(
              'name'                 => __( 'Footer Widget Area Five' , 'customizr' ),
              'description'          => __( 'Just use it as you want !' , 'customizr' )
        );
        return $default_widgets_area;
    }

    Next, add this to your child theme’s style.css. Adjust the percentages to suit your needs.

    #footer_four {
        width: 40% !important; /* Adjust */
    }
    #footer_five {
        width: 40% !important; /* Adjust */
    }
    Thread Starter Sevar

    (@sevar)

    Thank you very much, Menaka! The code works great! I only added the filters to style the areas equaly:

    // Adds a class to style footer widgets
    add_filter( 'footer_four_widget_class', 'my_footer_widget_class');
    function my_footer_widget_class() {
        return 'span6';
    }
    
    // Adds a class to style footer widgets
    add_filter( 'footer_five_widget_class', 'mygood_footer_widget_class');
    function mygood_footer_widget_class() {
        return 'span6';
    }

    Thanks!

    Glad that it worked, Sevar.
    And a neat solution through filters for dividing the areas equally!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add two equal footer widget areas below’ is closed to new replies.