Title: Highlight current post
Last modified: August 21, 2016

---

# Highlight current post

 *  Resolved [Solid Pixel](https://wordpress.org/support/users/plasmax/)
 * (@plasmax)
 * [12 years ago](https://wordpress.org/support/topic/highlight-current-post/)
 * Hi there, thanks for this plugin, you really saved my life!
    One question: I’ve
   got the archive on the sidebar as a menu, is it possible to highlight the current
   post?
 * thank you very much 🙂
 * [https://wordpress.org/plugins/simple-yearly-archive/](https://wordpress.org/plugins/simple-yearly-archive/)

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

 *  Plugin Author [wpseek](https://wordpress.org/support/users/alphawolf/)
 * (@alphawolf)
 * [12 years ago](https://wordpress.org/support/topic/highlight-current-post/#post-4970709)
 * Hey plasmax,
 * that’s a pretty uncommon usage scenario, so adding it to the source would quite
   bloat the plugin. Maybe a javascript/CSS solution would suffice.
 * May you please link to your archive/page so I can see what can be done with JS/
   CSS? 🙂
 *  Thread Starter [Solid Pixel](https://wordpress.org/support/users/plasmax/)
 * (@plasmax)
 * [12 years ago](https://wordpress.org/support/topic/highlight-current-post/#post-4970784)
 * sorry mate I totally forgot to attach the link!
    [http://1074092105.n1411413.test.prositehosting.co.uk/2.0/category/news/](http://1074092105.n1411413.test.prositehosting.co.uk/2.0/category/news/)
 * thanks 🙂
 *  Thread Starter [Solid Pixel](https://wordpress.org/support/users/plasmax/)
 * (@plasmax)
 * [12 years ago](https://wordpress.org/support/topic/highlight-current-post/#post-4970785)
 * sorry one more question: is it possible, when you load the page, to see the first
   year collapsed?
 *  Thread Starter [Solid Pixel](https://wordpress.org/support/users/plasmax/)
 * (@plasmax)
 * [12 years ago](https://wordpress.org/support/topic/highlight-current-post/#post-4970786)
 * I did a mistake, I meant: is it possible, when you load the page, to see the 
   first year expanded?
 *  Plugin Author [wpseek](https://wordpress.org/support/users/alphawolf/)
 * (@alphawolf)
 * [12 years ago](https://wordpress.org/support/topic/highlight-current-post/#post-4970790)
 * Hey plasmax,
 * expanding the first year would be done by adding the following javascript whereever
   you want:
 *     ```
       jQuery(document).ready(function() {
       	jQuery('#gk-sidebar #sya_container h3:first a:last').trigger('click');
       });
       ```
   
 *  Thread Starter [Solid Pixel](https://wordpress.org/support/users/plasmax/)
 * (@plasmax)
 * [12 years ago](https://wordpress.org/support/topic/highlight-current-post/#post-4970804)
 * it works like a charm!
    thank you very very very much! if you’ve got an idea 
   about how to highlight the current post it would be nice, if not, you did enough.
 * cheers!
 *  Plugin Author [wpseek](https://wordpress.org/support/users/alphawolf/)
 * (@alphawolf)
 * [12 years ago](https://wordpress.org/support/topic/highlight-current-post/#post-4970805)
 * Hi plasmax,
 * I’m pushing a little update first, because currently it’s not possible even with
   a CSS or Javascript solution. After I’ve released the updated version (which 
   will be in a couple of minutes), I’ll keep you posted about how to achieve your
   goal with JS. 🙂
 *  Plugin Author [wpseek](https://wordpress.org/support/users/alphawolf/)
 * (@alphawolf)
 * [12 years ago](https://wordpress.org/support/topic/highlight-current-post/#post-4970806)
 * So I released version 1.6.2.5, which allows you to use the following javascript
   snippet:
 *     ```
       jQuery(document).ready(function() {
       	if( jQuery('body.single-post').length > 0 ) {
       		var os_post_id = jQuery('body.single-post article').attr("id").match(/[\d]+$/);
       		jQuery('#gk-sidebar #sya_container ul li a[class=post-'+os_post_id+']').addClass('active');
       	}
       });
       ```
   
 * After that you can style the active link whatever you like with CSS, e.g.
 *     ```
       #gk-sidebar #sya_container ul li a.active { color: #27AAE1; }
       ```
   
 *  Thread Starter [Solid Pixel](https://wordpress.org/support/users/plasmax/)
 * (@plasmax)
 * [12 years ago](https://wordpress.org/support/topic/highlight-current-post/#post-4970817)
 * nothing to say mate, just a BIG thank you!
    you are very kind doing this for 
   free. this is Opensource!
 * 5 stars 🙂
 * thanks again!

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

The topic ‘Highlight current post’ is closed to new replies.

 * ![](https://ps.w.org/simple-yearly-archive/assets/icon-256x256.png?rev=1162212)
 * [Simple Yearly Archive](https://wordpress.org/plugins/simple-yearly-archive/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-yearly-archive/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-yearly-archive/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-yearly-archive/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-yearly-archive/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-yearly-archive/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [Solid Pixel](https://wordpress.org/support/users/plasmax/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/highlight-current-post/#post-4970817)
 * Status: resolved