Query Wrangler
[resolved] current class (3 posts)

  1. bart_behiels@yahoo.com
    Posted 4 years ago #

    hi (excuse my english),

    I like the plugin very much. But I would like it even more if it would be possible to apply a current class to the query widget. I'm using the query widget in my sidebar with only 'post title fields'. It would be very interesting if it would behave more like a menubar.

    Can anyone help me out?


  2. Jonathan Daggerhart
    Plugin Author

    Posted 4 years ago #

    Hmm... Off the top of my head, I can think of an easy way to do it with jQuery.

      jQuery('.query-[query_slug]-wrapper a.query-field-link').each(function(i,element){
        if (jQuery(element).attr('href') == window.location.href){

    This should be very close to what you would need to do that. You would need to change [query_slug] and 'my_custom_class' to the correct values for your site.

    This should be simple enough for QW to do, so I will add a class to a link if it is the 'current page being viewed' in the next major release (1.6).

    Hope this helps.

  3. bart_behiels@yahoo.com
    Posted 4 years ago #

    thanks, I'll try this one.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Query Wrangler
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic