Flexible Posts Widget
Current nav item highlighted? (3 posts)

  1. gloriagoldrea
    Posted 2 years ago #


    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!


  2. gloriagoldrea
    Posted 2 years ago #

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

    // 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');


    and then this to your css:
    .dpe-flexible-posts li.highlight a,
    .dpe-flexible-posts li.highlight a:visited {
    color:#339933 !important;

  3. DaveE
    Plugin Author

    Posted 2 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Flexible Posts Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.