Viewing 23 posts - 1 through 23 (of 23 total)
  • Author
  • #492445


    I using Enfold and I need that when I click in a button it’s show a Modal Popup with a code and also open a link in other tab.

    It’s possible open a modal popup and also open a new tab?

    Can you help me?




    You could have two links, like:

    <a href='#' id='link_to_another_tab'>Link to Another Tab</a>
    <a href='#?iframe=true' id='link_to_modal_popup' style='display: none;'>Link to Modal PopUp</a>

    And then with jQuery chain trigger them, like:

    $('#link_to_another_tab').on('click', function(){



    Hi Josue.
    This works well in chrome, but in firefox or safari the iframe shows up empty.
    any idea of a workaround?


    you have seen the publishing time?
    August 24, 2015 at 9:46 pm


    yes, why? do you know of something particular that has changed over the last 2.5 years regarding jquery/iframe support?
    let me know if you have another better approach regarding that.



    Did you adjust the value of the href attribute with the iframe parameter? In the example above, it will display a blank page. Please create a test page so that we can inspect it.

    Best regards,


    Ok, so I found out that it works fine except when the “triggering” link points to a file.

    So this works perfectly in all browsers :

    <a id='triggering_link' href='#'>Click me</a>
    <a id='link_to_modal_popup' href=''></a>

    but the following only works in chrome :

    <a id='triggering_link' href=''>Click me</a>
    <a id='link_to_modal_popup' href=''></a>

    any idea why is that ?
    private content : link to a page where you can test the 2 things above

    ps: the jquery chain :

    jQuery('#triggering_link').on('click', function(){

    Hi goch,

    I was not able to see the page. Please check in private.

    Best regards,


    Hi Victoria
    not sure why is that. It’s in password protected mode, so you should be able to see it.
    Have you entered the password? you don’t have access to the page at all?



    I get the same problem as Victoria on my end, do you have any ip blocking active maybe?

    Best regards,


    not sure what’s going on.. anyway, I just made the page public, you should be able to see it now! :)


    i noticed here on my end a code for functions.php of your child theme:
    i set the trigger-class to open-popup-link

    function popup_script() { 
    <script type="text/javascript">
        midClick: true
    <?php }
    add_action('wp_head', 'popup_script');

    Hi goch,

    Have you tried the solution by Guenni007?

    Let us know if this helps or you need more help from us.

    Best regards,


    hum… sorry, I don’t understand how to use Guenni’s code…
    here is my current function :

    function trigger_popup_on_linkClick(){
            jQuery('#triggering_link').on('click', function(){
    add_action('wp_footer', 'trigger_popup_on_linkClick');

    as you can see it makes reference to both my “triggering_link” (the one the user clicks), and the “link_to_modal_popup” (the one which shows up in the iframe).
    But Guenni’s code only make use of 1 id (“open-popup-link”). How can I link it to my “triggering_link” ?


    well it is a custom-class first.

    I have interpreted your desire to have a popup modal window on a link

    every link you can setup (in text-block or as alb element like a button) you can give a custom class to.
    so if there is a link like <a class="open-popup-link" href=" … </a> it will than open in a modal window.

    the code itself comes to child-theme functions.php

    i have that problem too on a flyout in which i placed a link to a film – allthough i add that ?iframe=true (or &iframe=true– depending if there is allready a ? ) it does not open in a popup window.


    I could not get your script to work unfortunately. Do you have a working example somewhere?

    I have interpreted your desire to have a popup modal window on a link

    Yes, what I want is :
    I have a link pointing to a file.
    When the user clicks that link the file is downloaded, and I want to open another page in a modal window at the same time.

    The solution I posted (Purchase code hidden if logged out)(Purchase code hidden if logged out) -link/#post-910966″>above works perfectly in chrome, but not in firefox/safari.



    The download and the modal window are working properly on Firefox. The download is starting automatically on Chrome but on Firefox, it’s asking for a confirmation which is normal.



    The download and the modal window are working properly on Firefox.

    you mean it works when you click the “click me with download” link on the page I posted?
    Here (on last macOS) it only works in chrome. With last firefox (58.0.2) or safari (11.0.3) (both without any plugin) the download is started and the popup is displayed, but the popup is fully black. You can’t see any content inside (cf screen recording in private data)



    Yes, it’s working on Firefox Windows 7. It might be related to the browser settings. Do you see any error in the console after the click? Here’s how the console can be accessed.

    Safari: (Purchase code hidden if logged out) -sfri20948/mac

    Best regards,


    – firefox:
    no error, nothing is printed in the console
    – safari:
    I got the following error printed :
    Failed to load resource: Frame load interrupted



    It seems to be a general issue on safari browser, not sure how to fix it though.


    I’m afraid you’ll have to separate the download and modal link for now.

    Best regards,


    ok. thanks for having a look. A pity there’s no way to do such a simple thing.
    I guess I will open the popup only in chrome, and for the other browsers I’ll open the link in another tab.



    Thank you for your understanding we much appreciate it.

    Best regards,

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

The topic ‘Is possible show a modal popup and also open a link ?’ is closed to new replies.