Title: Current nav item highlighted?
Last modified: August 21, 2016

---

# Current nav item highlighted?

 *  [gloriagoldrea](https://wordpress.org/support/users/gloriagoldrea/)
 * (@gloriagoldrea)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/current-nav-item-highlighted/)
 * Hi,
 * I’ve got my current nav highlighted for all other pages (when I am on a page,
   that page’s navigation is a different color) except for the pages that correspond
   to the widget. Is there a way to add this functionality? I can’t figure out how
   to make it work.
 * thank you!
    Gloria
 * [https://wordpress.org/plugins/flexible-posts-widget/](https://wordpress.org/plugins/flexible-posts-widget/)

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

 *  Thread Starter [gloriagoldrea](https://wordpress.org/support/users/gloriagoldrea/)
 * (@gloriagoldrea)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/current-nav-item-highlighted/#post-4690794)
 * Nevermind, I figured it out.
 * If anybody needs to do this:
 * Add this to your header:
    <script src=”//ajax.googleapis.com/ajax/libs/jquery/
   1.11.0/jquery.min.js”></script>
 * <script type=”text/javascript”>
    jQuery(document).ready(function($){
 *  // Get current url
    // Select an a element that has the matching href and apply
   a class of ‘active’. Also prepend a – to the content of the link
 *  var url = window.location;
 *  $(‘a[href=”‘+url+'”]’).parent(‘.dpe-flexible-posts li’).addClass(‘highlight 
   a’);
 *  });
    </script>
 * and then this to your css:
    .dpe-flexible-posts li.highlight a, .dpe-flexible-
   posts li.highlight a:visited { color:#339933 !important; }
 *  Plugin Author [DaveE](https://wordpress.org/support/users/dpe415/)
 * (@dpe415)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/current-nav-item-highlighted/#post-4691024)
 * Hi gloriagoldrea,
 * Thanks for posting this issue and a possible solution. I’m looking at what it
   would take to add that CSS class programmatically. I’ll post back to this thread
   if a future release adds this capability.
 * Thanks again!

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

The topic ‘Current nav item highlighted?’ is closed to new replies.

 * ![](https://ps.w.org/flexible-posts-widget/assets/icon-256x256.jpg?rev=984592)
 * [Flexible Posts Widget](https://wordpress.org/plugins/flexible-posts-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/flexible-posts-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/flexible-posts-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/flexible-posts-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flexible-posts-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flexible-posts-widget/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [DaveE](https://wordpress.org/support/users/dpe415/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/current-nav-item-highlighted/#post-4691024)
 * Status: not resolved