Site logo

Archived topic

Hyperlink not working correctly in elements

19 replies · Started by David on May 5, 2021

Viewing posts 1–15 of 20

I have created an go premium element to add a generate blocks button after the nav. I have added a url into the button, it goes to the correct page on the home page but then on other pages the url has changed to simply the same page that it is on, hope that makes sense.

Kind regards

David

Hi there,

can you share a link to the site where i can see the issue ?

https://www.dawngreenyoga.com/?preview

It is not a live site which is why preview so you can see it, the studio classes button in the nav. Works fine on home page but not other pages.

Kind regards

David

The links do not work when click on the button, should always go to the studio classes page but doesn’t on other pages.

Kind regards

David

I just tested the site and the Studio Classes button works for me from any page.
Can you test the site in Private / Incognito browser to eliminate any caching/cookie issues?

It is fine when you first load the page but I’m using a sticky header so when you scroll down then back up slightly it brings the button up but has the wrong url on the button.

It's easiest to tell that it's not working on mobile when you scroll down and slightly back up the green button appears before it goes back to fully mobile. If clock on that it takes you to itself on any page rather than studio page.

Tried it on multiple computers Norma caching issue mainly because no caching is currently employed let.

Any solutions, or have you been able to replicate the issue.
I think it’s a bug in either generateblocks or GeneratePress.

Kind regards

David

I tested across all browsers and devices and checked the URL in the Button which is correct.

In all all but one instance the Link worked correctly.

The only time it didn't was when i first visited the Contact Page on iOS Safari.... but it was only the first visit.

When a correct link doesn't work as intended it means that either:

1. Another clickable element is overlapping it - which doesn't seem to be the case.
2. Some Javascript is interfering with default onClick events.

Really trick to debug when i cannot replicate the issue consistently. So I have asked another of the Team to take a look to see if they can replicate.

In the meantime i would suggest disabling other plugins to see if another script is interfering and check it in an Private Browser ( no cache, no extensions ) and if possible on a different network ( as Routers and ISPs may also be caching code ).

I think it is case one overlapping as when I click it highlighting other site title area. If I change the priority of the button that may help?

Try editing the Block element - select the parent Container and in the Settings > Spacing give it a z-index value of say 10 you may also want to add a little left and right margin to the container so it avoids touching the other elements

Sounds like a plan, will try that and get back to you

Hello,

I didn't have much luck I decided to remove the button in mobile. Question is there a better hook to use which is better than generate after primary menu?

Hmmm... thats odd - i wasn't sure the z-index was the issue. But you can try some other hooks.
Theres the

generate_inside_navigation - will require some CSS to change its position.
generate_menu_bar_items - this will place it within the same container as the mobile menu / search icons.

I think I have worked out the issue. On all pages accept the home page I created an element for the hero images at the top. I reckon that element is taking presidence over the button as when you click it highlights the hero but if I move further down the page past the hero clicking the button works.

This archived topic is closed to new replies.