WordPress.org

Ready to get started?Download WordPress

Forums

Styling Sidebar (3 posts)

  1. markob83
    Member
    Posted 1 year ago #

    Hi all,

    I'm in the middle of creating my first theme and have been stuck on this for a few hours. Is there a way to style each active widget that is in a sidebar? I'm confused on how to call each widget and assign them different classes. Let me know if you need more info.

    Thanks,

    Mark

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    how to call each widget and assign them different classes

    how did you use 'register_sidebar()' in functions.php of your theme?

    the parameters in 'before_widget' - 'before_widget' => '<li id="%1$s" class="widget %2$s">' would add individual css classes and ids to each widget.

    http://codex.wordpress.org/Function_Reference/register_sidebar

    there is a related topic for even more css classes:
    http://wordpress.org/support/topic/how-to-first-and-last-css-classes-for-sidebar-widgets?replies=9

  3. markob83
    Member
    Posted 1 year ago #

    Thank you alchymyth. The links helped me.

Topic Closed

This topic has been closed to new replies.

About this Topic