Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1129583

    Hi!

    A while ago you helped me with some text in a popup: https://kriesi.at/support/topic/simple-text-in-popup-when-clicking-a-button/.

    The site we use this on still runs Enfold 4.2. When I try to update it to 4.5.7, I get the error magnificPopup is not a function, and the content that was previously in the popup is now displayed outside of the popup, on the page. I tried to fix it and I saw it was fixed here: https://kriesi.at/support/topic/magnificent-popup-not-workin-not-recognized-as-a-function/ but I cannot see what is done here exactly.

    The used code:

    function popup_inline() { ?>
    <script type="text/javascript">
    jQuery(window).load(function(){
        jQuery('.open-popup-link').magnificPopup({
          type:'inline',
          midClick: true // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href.
        });
    });
    </script>
    

    Can you help me with fixing this error? The site is currently back on 4.2 so there’s no error.

    Thanks!

    Daniel

    • This topic was modified 5 years, 1 month ago by Daniel.
    #1129603

    this is for child-theme functions.php – isn’t it?
    you have forgotten some important things:

    function popup_inline() { 
    ?>
    <script type="text/javascript">
    jQuery(window).load(function(){
        jQuery('.open-popup-link').magnificPopup({
          type:'inline',
          midClick: true // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href.
        });
    });
    </script>
    <?php 
    }
    add_action('wp_footer', 'popup_inline');

    btw: it works in the footer as well

    #1129609

    Hi @Guenni007,

    I’m sorry, that it the code I have (yes, in the child-themes functions.php):

    
    function popup_inline() { ?>
    <script type="text/javascript">
    jQuery(window).load(function() {
        jQuery('.open-popup-link').magnificPopup({
          type:'inline',
          midClick: true // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href.
        });
    });
    </script>
    <?php }
    
    add_action('wp_head', 'popup_inline');
    • This reply was modified 5 years, 1 month ago by Daniel.
    #1129840

    Hi,
    Thank you for the login & ftp access, I took a look at your site and found that you were using an old version of the header.php in your child theme.
    I uploaded the updated version and new your magnificPopup works correctly and you do not have the error.
    In your old header.php I didn’t see any customizations so I’m not sure why you have added it to your child theme, but you will find the file in your child theme renamed as header.php-old so if you do have customizations you will be able to get your code and move it to your new header.php

    Best regards,
    Mike

    #1129905

    Hi Mike,

    That indeed did the trick, thanks!

    #1130084

    Hi,

    Glad we could help!

    Please take a moment to review our theme and show your support https://themeforest.net/downloads
    Please bookmark Enfold Documentation for future reference.
    Thank you for using Enfold :)

    Best regards,
    Basilis

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘magnificPopup is not a function’ is closed to new replies.