Title: Current post CSS
Last modified: August 19, 2016

---

# Current post CSS

 *  [fouadovic](https://wordpress.org/support/users/fouadovic/)
 * (@fouadovic)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/current-post-css/)
 * Hello,
 * I have a post page where i have to display the post on the right, and a list 
   of last 6 posts on the left.
    And to show the current post highlighted on the
   left list (as **current_page_item** for pages) by adding a CSS class to the “
   li” of the current post.
 * Any help?
 * Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/current-post-css/#post-1760193)
 * naturally, this depends on the code that you are using for the six posts in the
   sidebar.
 * general steps:
 * get the current post id into a variable;
    compare this in the sidebar loop with
   the id of the posts; if equal, output class current into li element.
 *  Thread Starter [fouadovic](https://wordpress.org/support/users/fouadovic/)
 * (@fouadovic)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/current-post-css/#post-1760195)
 * Thankx Alchymyth,
 * I just find the solution here:
    [http://css-tricks.com/snippets/wordpress/list-posts-highlight-current/](http://css-tricks.com/snippets/wordpress/list-posts-highlight-current/)
 * Thanks for the help 😉
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/current-post-css/#post-1760200)
 * well researched –
 * imho, most solutions are already ‘out there’ – just sometimes difficult to find
   😉
 *  Thread Starter [fouadovic](https://wordpress.org/support/users/fouadovic/)
 * (@fouadovic)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/current-post-css/#post-1760201)
 * Yes… That’s why i’m in love with WP 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Current post CSS’ is closed to new replies.

 * 4 replies
 * 2 participants
 * Last reply from: [fouadovic](https://wordpress.org/support/users/fouadovic/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/current-post-css/#post-1760201)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
