WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Advanced! Css for built-in widgets (5 posts)

  1. Cathy Tibbles
    Member
    Posted 6 years ago #

    From pagesource, I can see that there are several classes the wp has assigned to the in-house widgets. But where do I find the list of them?

    for example: class="widget widget_pages"
    & h2 class="widgettitle"

    Anyone know? They are NOT in the default or classic themes.

  2. Cathy Tibbles
    Member
    Posted 6 years ago #

    anyone?

  3. flick07
    Member
    Posted 6 years ago #

    sorry, i have no idea where to find them...your question is too advanced for me =] i'm still trying to sort out my annoying ie sidebar problem =/

  4. scribblerguy
    Member
    Posted 6 years ago #

    From pagesource, I can see that there are several classes the wp has assigned to the in-house widgets. But where do I find the list of them?

    for example: class="widget widget_pages"
    & h2 class="widgettitle"

    Anyone know? They are NOT in the default or classic themes.

    That's because they individual widget class names are defined in the core WordPress files (the widgets.php file in the wp-includes folder).

    If you want a list of those, take a look at this screenshot attachment in Trac. Ignore the one with the "-alt" ending and just drop the ".gif" from the file names and you have all the widget classnames.

    Technical note: The generic "widget" and "widgettitle" class names can be customized. From the first few lines of the default theme's functions.php file:

    if ( function_exists('register_sidebar') )
        register_sidebar(array(
            'before_widget' => '<li id="%1$s" class="widget %2$s">',
            'after_widget' => '</li>',
            'before_title' => '<h2 class="widgettitle">',
            'after_title' => '</h2>',
        ));

    For more information, see Widgetizing Themes at the automattic.com website.

  5. Cathy Tibbles
    Member
    Posted 6 years ago #

    thank you! that's perfect. (I'm assuming that the -alt would be similar to the alternating classes assigned to comments?) I can't follow all that stuff on automatic. I'm really not sure its English. :)

    I'm not understanding why this isn't requested more often - maybe put in the codex somewhere? There have GOT to be other theme authors that want to match up the widgets so users can customize their own sidebars. There are some of us who are not up to writing widgets but can muster up the guts to change the css.

Topic Closed

This topic has been closed to new replies.

About this Topic