• Resolved capli

    (@capli)


    Hello Malihu,

    thank you for the plugin. I try to fix the id positions that are not respecting the sticky menu and scrolling under it. I want to add an offset value with your plugin to fix it. However, the plugin doesn’t seem to work no matter what I do in settings.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author malihu

    (@malihu)

    Hello,

    The issue you’re having happens because another script handles the link’s smooth scrolling. This script prevents “Page scroll to id” from doing its thing. That’s why changing plugin settings doesn’t seem to have an effect.

    I don’t know if the script that does this comes from your theme or another plugin cause all scripts are bundled in one js file.

    The script that currently handles your links and prevents “Page scroll to id” from scrolling the page is this:

    ...themes/Divi/js/custom.unified.js

    I saw that you correctly enabled “Prevent other scripts from handling plugin’s links” option but it won’ always work.

    So, there are 2 ways to solve this, so choose the one that works:

    1)Manually edit custom.unified.js (e.g. in the theme editor). In the script find the text:

    a[href*="#"]:not([href="#"]), .mobile_nav

    and replace it with:

    a[href*="#"]:not([href="#"]):not(.__mPS2id), .mobile_nav

    Replace it exactly as above and don’t change anything else in the rest of the code.

    Save the file and test your page.

    2)Edit your theme/child-theme footer.php template and add the following script above the closing body tag (</body>) and below wp_footer() function:

    <script>
    (function($){
    	$(window).on("load",function(){
    		$("#sticky a.__mPS2id[href*='#']:not([href='#'])").off("click");
    	});
    })(jQuery);
    </script>

    Save and test.

    Let me know ??

    Thread Starter capli

    (@capli)

    Thank you for the quick response. I tried both options and unfortunately neither of them worked. Smooth scrolling is turned off in Divi and I cannot think of any other plugin that would have this function.

    Plugin Author malihu

    (@malihu)

    No problem.
    I just checked your page and I don’t see the change in custom.unified.js or the custom script. Did you add any of them? Maybe you need to clear the cache?

    Thread Starter capli

    (@capli)

    I flushed the cache at the hosting provider and can see the change in custom.unified.js now. It still doesn’t seem like it’s working.

    Plugin Author malihu

    (@malihu)

    OK. Can you try the second way and flush the cache?

    Thread Starter capli

    (@capli)

    Plugin Author malihu

    (@malihu)

    The code has not applied on the frontend (if you visit your site and see the source code, the script is not there).

    Any chance you use a child-theme and you need to add the code to your child-theme’s footer.php?

    Thread Starter capli

    (@capli)

    We are not using child theme. I just checked the file in the Theme Editor and the code is there. That’s weird. https://www.dropbox.com/s/eur7y9lo3nfw6yl/Screenshot%202021-02-18%20081928.jpg?dl=0

    Plugin Author malihu

    (@malihu)

    Yes, I saw that you can see the code in the editor. Maybe you need to clear/flush the cache?

    Thread Starter capli

    (@capli)

    I tried to deactivate all the plugins on the staging page in combination with both scripts and flushed everything. Nothing worked. There is also a file called “theme-footer.php” in Divi directory, but it has no </body> or wp_footer().

    https://www.staging3.wurkfurniture.com/projects/

    Plugin Author malihu

    (@malihu)

    Can you add the script at the end of theme-footer.php to see if it gets included?

    Also, is there an option to add javascript code in DIVI settings?

    Thread Starter capli

    (@capli)

    I already added `<script>
    (function($){
    $(window).on(“load”,function(){
    $(“#sticky a.__mPS2id[href*=’#’]:not([href=’#’])”).off(“click”);
    });
    })(jQuery);
    </script>` to the end of theme-footer.php. There is also an option to add the javascript to the <body> in Divi settings. I did that and I also added a code module with the javascript to https://www.staging3.wurkfurniture.com/projects/. Still no change.

    Plugin Author malihu

    (@malihu)

    Yeah just saw it but it won’t work since it adds the code before the theme’s scripts. This will only work if the code is added in footer.php.

    This is weird because I just tested DIVI 4.9.0 and I can successfully add code in footer.php and of course it’s passed on the frontend.

    Can you try one more time to add the script in footer.php, clear/flush cache and let me know to see if it appears on the frontend?

    Thread Starter capli

    (@capli)

    I added the code to the footer.php above the closing body tag (</body>) and below wp_footer() function and I can see it on the frontend. But it doesn’t seem like the plugin is handling it (I set the offset to 500 px).

    Plugin Author malihu

    (@malihu)

    I can’t see the script when viewing the source on https://www.staging3.wurkfurniture.com/projects/. The script does not seem to get applied on the frontend.

    I don’t know why but your theme footer.php doesn’t seem to work… So, try again the 1st way (edit custom.unified.js) but now change:

    a[href*="#"]:not([href="#"]):not(.__mPS2id), .mobile_nav

    to:

    a.none, .mobile_nav

    Save the file, clear cache, test.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Plugin is not working in Divi’ is closed to new replies.