简体   繁体   中英

Adding a fourth column for widgets in a footer area

My footer area currently has 3 widgets in 3 colummns. When I add a fourth widget to the area it breaks it up so it becomes 2 lines of widgets, with 2 columns on each line.

I'd like to just make the footer area have 4 columns for widgets, all on one line.

I found this code in the functions.php area and I'm not sure how to adjust the code. Many thanks.

Register widgetized area and update sidebar with default widgets
The first widget is not needed, but the default widgets are here.. so :(
If I update the options then switching theme will result in a loss of customization.
This solution is not very elegant.

function emerald_e_widgets_init() {
    register_sidebar( array(
        'name'          => __( 'Footer', 'emerald_e' ),
        'id'            => 'footer',
        'before_widget' => '<div id="%1$s" class="widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<h3>',
        'after_title'   => '</h3>',
    ) );
}
add_action( 'widgets_init', 'emerald_e_widgets_init' );

The following code, when placed in your CSS file should accomplish the 4 column grid you're looking for. Normally I'd prefer to use % widths but your theme seems to be using px everywhere so I just stuck with that.

.fb_iframe_widget span {
    max-width: 210px;
 }

 #tertiary .widget {
    width: 210px;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM