Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/257.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 向WordPress小部件添加类_Php_Html_Wordpress - Fatal编程技术网

Php 向WordPress小部件添加类

Php 向WordPress小部件添加类,php,html,wordpress,Php,Html,Wordpress,我需要向widget ul添加一个引导类。我尝试了register\u侧栏的类参数,但该类没有出现 有任何过滤器可以进行这种类型的修改吗?不完全是您想要的,但是您可以通过将'class'=>'ulstyle',添加到注册表(register\u sidebar中,然后在css添加中,将类添加到小部件(在functions.php文件中) .ulstyle ul li { font-size: 12px; } register_侧边栏类似于: register_sidebar( arr

我需要向widget ul添加一个引导类。我尝试了
register\u侧栏的类参数,但该类没有出现


有任何过滤器可以进行这种类型的修改吗?

不完全是您想要的,但是您可以通过将
'class'=>'ulstyle',
添加到
注册表(register\u sidebar
中,然后在css添加中,将类添加到小部件(在functions.php文件中)

.ulstyle ul li 
{
    font-size: 12px;
}
register_侧边栏类似于:

register_sidebar( array(
    'name'          => __( 'Footer Widget Area', 'twentyfourteen' ),
    'id'            => 'sidebar-3',
    'class'         => 'ulstyle',
    'description'   => __( 'Appears in the footer section of the site.', 'twentyfourteen' ),
    'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    'after_widget'  => '</aside>',
    'before_title'  => '<h1 class="widget-title">',
    'after_title'   => '</h1>',
) );
register\u侧栏(数组(
'name'=>uuu('Footer Widget Area','Twenty14'),
'id'=>'sidebar-3',
'class'=>'ulstyle',
“description'=>\(“出现在网站的页脚部分。”,“Twenty14”),
'在小部件'=>''之前,
'在小部件'=>''之后,
“在标题“=>”之前,
“在标题“=>”之后,
) );

我需要将该类添加到ul元素中,因为它是引导类,必须在“ul”中。我已经添加了class=>'',但这不会显示ul元素上的类。您希望将该类添加到哪个小部件?我想添加到所有小部件或至少具有列表的小部件。我可以用jQuery来做,但我想用wordpress过滤器或php来做。