Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #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
    Martin

    #1233142

    Hey 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,
    Rikard

    #1233158

    and where does your jQuery load : in the footer?
    Try to load your script above as

    add_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
    }
    #1233449

    Hey 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
    Martin

    #1233487

    by 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.

    #1233533

    Thank 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, 3 months ago by gugler.
    #1234081

    Hi,

    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,
    Ismael

    #1234088

    Hi,

    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
    Martin

    #1234688

    Hi,
    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,
    Mike

    #1234722

    Hi,
    no I don’t need any futher help because I fixed it on my own. Thank you for your kind support.

    Best regards,
    Martin

    #1234789

    Hi,
    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

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