Tagged: MagnificPopup
-
AuthorPosts
-
July 24, 2020 at 9:27 am #1232905
Hi everyone,
i’ve updated my enfold parent theme from 3.7 to 4.7.6 and now my menu is crashed and the following error occurs:
links.not(...).addClass(...).magnificPopup is not a function
I’ve seen many topics around in this forum about the problems with magnificPopup but I haven’t found a solution for my problem yet.
I put this code into my functions.php, now it looks a little bit better but not how it looked before the update. Do you have any suggestions?
add_action( 'wp_head', 'enfold_customization_add_magnific_handler' ); function enfold_customization_add_magnific_handler() { ?> <script type = "text/javascript"> jQuery(document).ready(function() { jQuery('a[rel=magnific]').magnificPopup({ type: 'inline', preloader: false, }); }); </script> <?php }
Kind Regards
MartinJuly 25, 2020 at 6:02 am #1233142Hey Martin,
I see more than one thing which is different when comparing your live and dev site, what exactly do you need help with?
Best regards,
RikardJuly 25, 2020 at 7:46 am #1233158and where does your jQuery load : in the footer?
Try to load your script above asadd_action('wp_footer', 'enfold_customization_add_magnific_handler');
and what should the popup script do?
maybe a midclick : true can do the trick:add_action( 'wp_footer', 'enfold_customization_add_magnific_handler' ); function enfold_customization_add_magnific_handler() { ?> <script type = "text/javascript"> jQuery(document).ready(function() { jQuery('a[rel="magnific"]').magnificPopup({ type: 'inline', midClick: true, preloader: false, }); }); </script> <?php }
July 27, 2020 at 8:32 am #1233449Hey Rikard & Guenni007,
there was a missing style.css file. I’ve disabled it while testing the website. But the menu is still crashed.
@Guenni007 I think the popup script should open the menu-content.Kind Regards
MartinJuly 27, 2020 at 11:48 am #1233487by the way: do you have an older child-theme header.php ? The lightbox setting on that has changed – so if you got – actualize this with the newest one.
________
On Enfold ( i do not know it this is default setting ) there is a setting to load jQuery in the footer – so that was the reason for my question.
If you load that script in the head area.So – to understand it right. You go to your menus and on one or more items you set with rel = magnific
first the selector is wrong – i did not see it first too on your code above.
('a[rel="magnific"]')
then – what do you like to open? do the menu-items lead to a unique ID on that page – or do they have as target a website ?
f.e. if you like to open a website with that link then type : ‘iframe’ , is to use.July 27, 2020 at 3:37 pm #1233533Thank you for help.
The desktop menu is working now. But I have a problem with my mobile menu. The hamburger button and the search icon don’t show up. Unfortunately the whole a tag “advanced menu toggle” doesn’t exist in my code. Do you know where I can add this line of codes? I already tested my header.php and it doesn’t change anything, if I override it with the new version. I also deleted my cache.
<a id="advanced_menu_toggle" href="#" aria-hidden="false" data-av_icon="" data-av_iconfont="entypo-fontello" title="Menü einblenden." class="mobile"><span class="icon" aria-hidden="true"></span><span class="screen-reader-text">Menü einblenden.</span></a>
Kind Regards
Martin- This reply was modified 4 years, 4 months ago by gugler.
July 30, 2020 at 6:24 am #1234081Hi,
Thank you for the update.
We can see that the mobile menu is now working properly, but it looks like it’s using the older version of the mobile menu. Did you add modifications in the default menu or header previously? Does it work when you temporarily disable those modifications?
Best regards,
IsmaelJuly 30, 2020 at 7:27 am #1234088Hi,
yes I made customizations in the helper-main-menu.php. Otherwise it didn’t work. Unfortunately the code of advanced_menu_toggle and advanced_menu_hide didn’t exist in my code, so I’ve added it in helper-main-menu.php.
Kind Regards
MartinAugust 3, 2020 at 12:40 am #1234688Hi,
Sorry for the late reply, I took a look at both of your sites mobile menu and they both seem to work now, do you need any further help on this topic?Best regards,
MikeAugust 3, 2020 at 6:57 am #1234722Hi,
no I don’t need any futher help because I fixed it on my own. Thank you for your kind support.Best regards,
MartinAugust 3, 2020 at 12:17 pm #1234789Hi,
Glad to hear this is sorted out, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘MagnificPopUp is not a function’ is closed to new replies.