Widget Title Links
[resolved] Current page...? (5 posts)

  1. crzyhrse
    Posted 1 year ago #

    Is there a way to style the link so it highlights when it is on the page it is set to...? Some current page selector / css to maybe do this...?


  2. ragulka
    Plugin Author

    Posted 1 year ago #

    Perhaps you can try a CSS attribute selector: http://www.w3schools.com/css/css_attribute_selectors.asp

  3. crzyhrse
    Posted 1 year ago #

    Yes, and thanks for the link, still learning into all this and use w3 schools a lot...

    I am asking though if you know what the selector actually is for widget titles, as I am imagining that the widget uses selector(s) to make the links happen...? I also realize that there is much, much more here that I don't know than I do, so that I may be asking a dumb question... But if you could even just point me a little deeper somehow that'd be great...

    Interesting that this upgrade came as my question occurs... I can see no differences in what the widget does and am curious what the widget_title_link filter does...?

  4. ragulka
    Plugin Author

    Posted 1 year ago #

    You can use the filter to override the actual link that the title points to. However, it doesn't help you.

    Detecting the url of the current page is quite involved and I am not sure this is something that I want to do in the plugin. You could, however, hack together something in your theme's functions.php file.

    I'd start with trying to get the URL of the current page and then hook into the dynamic_sidebar_params filter to see if you can find any widgets whose title link is the same as the current url - and then you can pretty easily add a "current-page" (or whatever) class to it.

    This is by no means an easy route to take, and requires pretty good understanding on how WordPress and widgets work though.

  5. crzyhrse
    Posted 1 year ago #

    Thank you so much for your reply here... This sort of thing is way over my head at this point, maybe sometime down the road I'll have learned enough to be able to do something like that, maybe... :-)

    And again thanks...

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Widget Title Links
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.