WordPress.org

Ready to get started?Download WordPress

Forums

Current Class in Sidebar (5 posts)

  1. vince23
    Member
    Posted 1 year ago #

    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

  2. kjodle
    Member
    Posted 1 year ago #

    <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.

  3. vince23
    Member
    Posted 1 year ago #

    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 ?

  4. vjpo
    Member
    Posted 1 year ago #

  5. kjodle
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.