Forums

Highlight current post in sidebar? (5 posts)

  1. lassebo
    Member
    Posted 1 year ago #

    Hey there,

    In my sidebar I have a list of posts from my archive. The list remains in the sidebar in the single view. I'd like to highlight the post that is currently shown in my sidebar menu.

    I would prefer to do this with CSS. Now how can I assign something like a "current" class/id to the active post list tiem. The output should look something like this:

    <ul>
    <li>post 1</li>
    <li>post 2</li>
    <li id="current_post">post 3</li>
    <li> post 4</li>
    </ul>

    When post 3 is currently shown in the single view.

    Thanks in advance,

    Lasse

  2. TheNut
    Member
    Posted 1 year ago #

    Looking for the answer myself :)

  3. keasone
    Member
    Posted 1 year ago #

    No Solution available for that?? please give me a hint!

  4. geraldmorales
    Member
    Posted 1 year ago #

    same here... no information found. This simple thing seems impossible to do with posts.

  5. lebaggblu
    Member
    Posted 8 months ago #

    I had the same problem and found a solution using JavaScript and jQuery. Here's a write-up of how it was done:

    http://www.kevinleary.net/blog/2008/03/12/highlight-current-wordpress-post-on-the-sidebar/

    Kudos

Topic Closed

This topic has been closed to new replies.

About this Topic