Active links in navigation

This support request was posted in Smart by mertxe

Request ID #36745 In Progress
  • Hi! Me again 🙂
    Don’t know what i’m doing wrong but i’ve set up 3 anchor links in my home page, but they are always “active”, i just want them to turn blue only when the scroll is at that section. Is this possible? I can’t find what i’m doing wrong in this menu.

    Thanks!

    Juanfra Aldasoro

    Hi Mertxe,

    I hope you are doing well.

    Those three links are custom links you’ve added to the menu with the anchor link as the ID of the row you’re trying to link to?

    Best,
    Juan.

    Yes, i’ve used anchor links.

    I’ve changed the way “campaña” is linked to have a better example: campaña is linked with only “#campana” and then i can have smooth scrolling and correct active coloring, but if i’m navigating a inner page like shop, it doesn’t work.
    Then in “locales” the link is “https://mertxe.com.ar/mirandoalmar/#locales”, it’s always colored when at the home page, but it works from inner pages.

    i need the best of both options: smooth scrolling, right coloring, and that it works when i’m at inner pages.

    is this possible?

    Juanfra Aldasoro

    Hi Mertxe,

    Thanks for the prompt response.

    Yes, you are right. They are being colored because you’re using the full URL instead of just linking to the anchor you need. This functionality was meant to work for one-page sites.

    Would you please try to replace the file smart/includes/nav-menus/class-nice-custom-navigation-menu.php with this new file and see if this patched version works for you? https://cloudup.com/cTgoieHQixc

    That will clean the links if you’re on the same page automatically and put the anchor, with regards to the CSS, you will need to find a workaround when they’re in the same page because they have the assignment to use the “current page” class.

    Best,
    Juan.

    Best,
    Juan.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Login to your Account

Welcome back! Please log in to your account by filling the fields below:

Forgot?

Not a member? Create a free account.

Create a Free Account

You're 27 seconds away from some awesome WordPress free stuff, benefits and more. Create a free account and have access to our free products, benefits and more!

Already have an account? Log in
Secure Server