WordPress.org

Support

Support » How-To and Troubleshooting » Current Class in Sidebar

Current Class in Sidebar

  • Hey guys,

    I ve created a sidebar with some linked sites (using the text widget) and would like to create a “current class” to mark the current site.
    How can I do this ?

    Thanks in advance,

    vince

Viewing 4 replies - 1 through 4 (of 4 total)
  • kjodle
    Participant

    @kjodle

    <a class="current_class" href="http://example.com/">Link text here</a>

    In stylesheet:

    .current_class {style info here;}

    I’m not quite sure what you mean by “current site”, however.

    I mean a class that indicates on which site Im currently on (by color change of a link).

    You did it manually in your example.

    I want the class to appear automatically and style it in CSS.

    Or is there no automatically created “current”-class in the sidebar widget ?

    kjodle
    Participant

    @kjodle

    Do you mean “site” or “page”? The latter doesn’t mean anything in this case. If you mean “page” then this can be accomplished, but you will need to install a PHP widget and use that instead of the text widget.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Current Class in Sidebar’ is closed to new replies.