WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Styling just category widget (4 posts)

  1. nemci7v
    Member
    Posted 3 years ago #

    Is it possible to have particular style for the default category widget? I checked the source and all the widgets are wrapped in <div id="widgit-sidebar" class="widgit-area">

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    You'd need to change the generated widget markup created by register_sidebar in functions.php from:

    'before_widget' => '<div id="widget_sidebar" class="widget-area">',

    to something like:

    'before_widget' => '<div id="widget_sidebar" class="widget-area %2$s">',

    In theory, this would add a class 'widget_text' to the output that you could then use in your CSS.

  3. nemci7v
    Member
    Posted 3 years ago #

    Esmi that theory totally works! Thanks!

  4. esmi
    Forum Moderator
    Posted 3 years ago #

    You're welcome.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags