Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter s19nzh

    (@s19nzh)

    It was indeed the jQuery dependency declaration. I registered, or rather, removed the wp_deregister_script(‘jquery’), and everything is working as intended.

    Thank you for your prompt response and support!

    Thread Starter s19nzh

    (@s19nzh)

    I switched to twentytwenty without deactiving all other plugins and saw that the script is loaded after footer (together with the inline script defining two variables). Hopefully this rules out plugin conflict.

    Now it seems like something else is preventing the script from being properly enqueued.

    About jQuery, the previous admin had a webpack build process that bundles all custom js including jQuery. Should I enqueue jQuery from functions.php instead?

    *Edit:
    I checked the source code and noticed ‘jquery’ is specified as dependency:
    wp_register_script( 'bodhi_svg_inline', BODHI_SVGS_PLUGIN_URL . $bodhi_svgs_js_path, array( 'jquery' ), '1.0.0', $bodhi_svgs_js_footer );

    It seems like I should register jQuery in functions.php with the handle ‘jquery’ in order for the above script to be loaded?

    • This reply was modified 4 years ago by s19nzh.
    Thread Starter s19nzh

    (@s19nzh)

    Hi Ben,

    Thank you for the quick response. The plugin is being tested on a dev environment that will require VPN to access so unfortunately, I can’t share the URL.

    I looked for the script in the rendered source and it’s not there. So I tried adding it manually to the footer and got the error jQuery is not defined. I was able to resolve this but then I got another error syaing “bodhisvgsInlineSupport is not defined”. I know it’s hard to say without looking at the code, but do you know what might have prevented the script being output in the footer?

    • This reply was modified 4 years ago by s19nzh.
    Thread Starter s19nzh

    (@s19nzh)

    Thank you for your quick response. Resave my permalinks settings worked.

Viewing 4 replies - 1 through 4 (of 4 total)