简体   繁体   English

在页脚区域为小部件添加第四列

[英]Adding a fourth column for widgets in a footer area

My footer area currently has 3 widgets in 3 colummns. 我的页脚区域当前在3个列中有3个小部件。 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. 当我向该区域添加第四个小部件时,它将其分解,因此变成2行小部件,每行两列。

I'd like to just make the footer area have 4 columns for widgets, all on one line. 我只想让页脚区域在一行上有4个小部件列。

I found this code in the functions.php area and I'm not sure how to adjust the code. 我在functions.php区域中找到了此代码,但不确定如何调整代码。 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. 将以下代码放入CSS文件中,即可完成您要查找的4列网格。 Normally I'd prefer to use % widths but your theme seems to be using px everywhere so I just stuck with that. 通常我更喜欢使用%宽度,但是您的主题似乎在所有地方都使用px,因此我只是坚持使用。

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

 #tertiary .widget {
    width: 210px;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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