Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

When trying to work with html anchor tab items won’t open

  • Hello GeneratePress support team,

    I’m trying to link from a separate menu to specific tab items in my GenerateBlocks tab menu so that the correct tab automatically opens when the link is followed.

    What I’ve tried so far:

    I added HTML anchors to the tab items and used links like #test-1, #test-2, etc. While these links scroll to the correct position, if the tab item is not already open, the page scrolls back up.
    I also tried placing the HTML anchor directly on the buttons. This scrolls to the correct location but does not open the corresponding tab item.
    I experimented with various JavaScript solutions to “click” the button automatically, so the tab would open, but without success.
    I came across this forum discussion, which suggests that this should be possible: https://generatepress.com/forums/topic/can-i-change-the-default-opened-tab-depending-on-the-link/. However, I haven’t been able to get it working.

    Do you have any suggestions on how to best approach this?

    Thank you very much for your help!

    Where links are: Links with # to anchor

    Where they need to go: Tab items with #test-1 opened

  • Hi there,

    On the page you linked, I did not find the GB tabs, can you tell me which section to look at?

  • Hi,

    There was an issue, i’ve updated the page url. Now you can find it.

  • The page is leading to 404 error, can you check?

  • I think the issue was because it was on private. In pages its called : Rust en verbinding test

  • OK, I can see it now 🙂

    The anchor behaviour is not quite right, can you disable all plugins except GB and GP Premium to test?

    And switch to the parent GP theme.

    Let me know how it goes!

  • That was it, i had some code in my child theme that conflicted. I’m sorry for bothering you since i could’ve found the solution myself.

    Thanks anyway 😀

  • No problem 🙂 Glad you found out the cause!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.