简体   繁体   English

更改 wordpress 的类别小部件标题中的字体大小

[英]Change font size in categories widget title for wordpress

I want to change the font size for title, i got this code:我想更改标题的字体大小,我得到了这个代码:

    $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Categories' );

    /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
    $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );

Any ideas?有任何想法吗? Thank You.谢谢你。

When a theme registers a sidebar it should be something like this:当主题注册侧边栏时,它应该是这样的:

if ( function_exists('register_sidebar') )
  register_sidebar(array(
    'name' => 'Name of widgets area',
    'before_widget' => '<div class = "widget-area">',
    'after_widget' => '</div>',
    'before_title' => '<h3 class='widget-title>',
    'after_title' => '</h3>',
  )
);

before_title and after_title specifies the tag (and class) surrounding the title. before_titleafter_title指定标题周围的标签(和类)。 In your CSS your can use this to add style.在您的 CSS 中,您可以使用它来添加样式。 For example you can add this to your CSS file:例如,您可以将其添加到 CSS 文件中:

h3.widget-title
{
   font-size: 15px;
}

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

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