Tagged: 

Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #967861

    Hi I have updated some web sites with last Enfold version. In all of them I activated the Magnificent Popup with the following snippet in 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 }

    Everything works fine except for one site in which the window that should be hidden unless one clicks on the link is actually opened. Any clues?

    Thanks

    #970490

    Hey Elena,
    The snippet above is not complete, please ensure your snippet contains the last line like this:

    function popup_inline() { ?>
    <script type="text/javascript">
    jQuery(window).load(function(){
    	jQuery('.open-popup-link').magnificPopup({
    	  type:'inline',
    	  midClick: true
    	});
    });
    </script>
    <?php }
    
    add_action('wp_head', 'popup_inline');

    If you do have the full snippet, and your console is giving the error “not recognized as a function” this could also be a js conflict, Try disabling your plugins. If that resolves the issue, reactivate each one individually until you find the cause.
    If this doesn’t solve and your popup box is showing when it should be hidden, please ensure the hidden div contains the class “mfp-hide”
    If none of this helps, please include a admin login in the private content area so we can take a closer look.

    Best regards,
    Mike

    #971332

    Hi Mike, excuse me but I actually added also the line
    add_action('wp_head', 'popup_inline');

    I just forgot to paste it in my previous msg.

    However it doesn’t work. In reality it always worked and messed up after an update. So I am pretty sure that both the snippet in the funcrions.php file and the snippet in the html code is ok.

    I will try to disable the plugins and see if something changes. Otherwise I will send you an access to the site.

    Thank you very much

    #971502

    Hi,
    We will be happy to take a look if your tests don’t solve.

    Best regards,
    Mike

    #972367

    Hi Mike, no way: the problem is still there. The popup modal is on the pages of some products. I add in a private section the access to the web site and one example page (a product) where the problem exists.
    Also I noticed that in product pages the main menu (that should be sticky at the top) has a transparent space above it. As it is detached from the very top of the screen, which is quite annoying.

    If you could help me I would appreciate it very much

    Thanks

    • This reply was modified 6 years, 1 month ago by elenapoliti.
    #972817

    Hi,
    I see your [jQuery(…).magnificPopup is not a function] error.
    Please check the file & folder permissions at: \wp-content\themes\enfold\js\aviapopup\
    this is where the magnificPopup script is, it is used for many enfold popups such as the cookie notice.
    Perhaps try to re-upload the scripts in the folder.
    I tested your popup function and the popup code on my localhost, so they are fine.
    You said this happened after you updated, did you update via FTP?
    If so did you remove the enfold theme folder first, or did you try to overwrite the folder? This will cause issues.

    Best regards,
    Mike

    #973225

    Hi Mike I did try to cancel completely the enfold folder files and copy the new version via FTP, but still the problem remains.

    Actually the funny things is that I did the same with other three web sites and everything went well: the popup function worked and nothing broke.

    I am working abroad for a month and I don’t have with me a local copy of the web site, so I cannot test it locally in a quick way (I should duplicate the whole web site and download it locally but it would take quite a long). Nothing you could do from your side to help me?

    Thanks

    #973271

    Hi,
    Please include FTP access in the Private Content area, so we can take a closer look.

    Best regards,
    Mike

    #973284

    Here they are! Thanks

    #973301

    Hi elenapoliti,

    Now the JavaScript is loaded only when required, I guess magnificPopup is not loading for the products and so you need to load it explicitly.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #973334

    Could you please suggest me how could I load it explicitly?
    Thanks

    #973754

    Hi elenapoliti,

    I added the code, please check if the page is working properly.

    Best regards,
    Victoria

    #975381

    Sorry Victoria for answering only now. Unfortunately it still doesn’t work.

    #976095

    Hi,

    Thanks for the update.

    We added the magnific popup style to the queue along with the needed scripts and created another hook to separate the internal script so it loads when the required files are available. It should work properly now.

    Best regards,
    Ismael

    #976851

    Thanks Ismael, now finally it work perfectly and smoothly!!!

    Such a great team you are!

    #976916

    Hi,
    unless there is anything else we can help with, shall we close this then?

    Best regards,
    Mike

    #1095821

    @Victoria what is the code block that you inserted to load magnificPopup explicitly?

    #1096665

    Hi,


    @smartstartinc
    : I actually forgot what we did here. What is the issue that you have with the lightbox script? Please create your own ticket and provide the site url in the private field so that we can inspect the issue.

    Best regards,
    Ismael

    #1096731

    No worries.

Viewing 19 posts - 1 through 19 (of 19 total)
  • The topic ‘Magnificent Popup not workin (not recognized as a function)’ is closed to new replies.