WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. John
    Member
    Posted 3 months 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...?

    https://wordpress.org/plugins/widget-title-links/

  2. ragulka
    Member
    Plugin Author

    Posted 3 months ago #

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

  3. John
    Member
    Posted 3 months 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
    Member
    Plugin Author

    Posted 3 months 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. John
    Member
    Posted 3 months 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...

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.