• Resolved allexarh

    (@allexarh)


    Hi, I would like to add a link in the title of a tab.

    I tried on this idea, but it didn’t work:

    [tabs title="" disabled="false" collapsible="false" active="0″ event="mouseover"]
    
    [tab title="<a href="https://www.google.com/">Content</a>"][/tab]
    
    [/tabs]

    Is there a way to achieve this, please?

    Thanks,
    Alex.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Matt Lowe

    (@squelch)

    Hi @allexarh,

    Sorry but it’s not possible. WordPress doesn’t allow HTML to be embedded inside of a shortcode, and if you did add a link it would cause all kinds of difficulty for the code that generates the actual tabs. I’m not sure how it would work anyway: if someone clicks a tab, instead of showing the tab content, you would be taking them to a new page…? Which breaks the mental model of a tab…

    I would recommend writing some content to go with the link, putting it in as the tab content, and then adding the link under that. So someone would then click a tab, be shown the intro text, and then choose whether to follow the link or not.

    If you REALLY want to have clicking a tab go to a new page (which I don’t recommend) then the only way to do that would be to write some JavaScript to detect the click on the relevant tab and have that script then perform the redirect.

    Thread Starter allexarh

    (@allexarh)

    Ok, I understand, I will adapt.

    (to answear your question “if someone clicks a tab, instead of showing the tab content, you would be taking them to a new page…?” there would have been no need to click it, as I set it to show the content on mouseover)

    Thank you for the really quick response, have a great day!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add link to tab title?’ is closed to new replies.