• Resolved Linksbreaker

    (@linksbreaker)


    Hello there!

    I’m wondering if there is a way to add a custom link to a tab instead of using a template or content (text editor).

    I’m trying to achieve this using a JS snippet, but I still can’t get it to work.

    I appreciate some guidance to hopefully address this client requirement.

    Thanks in advance,
    LB


    
    add_action( 'wp_footer', function () { ?>
    
    <script defer>
    
    // Select the target "li" element and the "span" element within it
    const targetLi = document.getElementById("my-custom-tab-ID");
    const titleSpan = targetLi.querySelector(".eael-tab-title.title-after-icon");
    
    // Create the "a" element with the link and target attribute
    const newAnchor = document.createElement("a");
    newAnchor.;
    newAnchor.target = "_blank";
    
    // Extract the title text from the span
    const titleText = titleSpan.textContent;
    
    // Wrap the title text with the "a" element
    newAnchor.textContent = titleText;
    titleSpan.textContent = ""; // Clear the existing text in the span
    titleSpan.appendChild(newAnchor); // Add the "a" element as a child of the span
    
    </script>
    
    <?php } );
    • This topic was modified 9 months, 2 weeks ago by Linksbreaker.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Ashikur Rahman

    (@ashikurwp)

    Hi Linksbreaker,

    Greetings. Sorry for not getting back to you sooner.

    Instead of using the Advanced Tab, consider utilizing our Creative Button elements from Essential Addons to achieve this. Currently, adding a custom URL for the content type on the Advanced Tab is unavailable.

    Hope you understand.
    Thank you.

    Plugin Support Ashikur Rahman

    (@ashikurwp)

    Hi?Linksbreaker,

    Greetings. Hope you’re doing well.

    We have not heard from you since our last conversation, so we are proceeding to close the topic. Please be aware that you are always welcome to reopen the topic if you have any further questions or concerns.

    Best regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Advanced Tabs’ is closed to new replies.