Settings button not working within a custom theme

I can’t get the “setting” button to functioning “jquery undefined error” jQuery is loading after the bb-plugin scripts. Please help.

Hey Chuck,

Sorry to hear about the issue! It sounds like there might be a conflict somewhere. Would you mind sending over a temporary login so we can test?

Justin

[Content Hidden]

Thanks, Chuck. I’m checking this out now.

Justin

Hey Chuck,

It looks like jQuery is being loaded a few times, once in the head and once in the footer. The builder also loads jQuery if it doesn’t find it (or if it finds an older version) but that wouldn’t be the case here since 1.11 is being loaded in the head.

It looks like many of your scripts are being inserted in footer.php which can cause conflicts with dependancies. Instead, you should be using wp_enqueue_scripts (you can still load them in the footer with that). You can also enqueue jQuery like this since it’s already registered by WordPress…

wp_enqueue_script('jquery');

Let me know if you have any questions about that.

Justin

I forgot to mention that the issue is you are loading jquery in footer.php after the builder scripts. Using wp_enqueue_scripts will ensure that it is loaded before them since it is defined as a dependency.

Justin

Thank you very much Justin. Your quick and helpful response is exactly the reason why we chose Beaver Builder over the other visual editors.

Your review and recommendation worked.

“It looks like jQuery is being loaded a few times, once in the head and once in the footer. The builder also loads jQuery if it doesn’t find it (or if it finds an older version) but that wouldn’t be the case here since 1.11 is being loaded in the head.”

“It looks like many of your scripts are being inserted in footer.php which can cause conflicts with dependancies. Instead, you should be using wp_enqueue_scripts (you can still load them in the footer with that). You can also enqueue jQuery like this since it’s already registered by WordPress…”

wp_enqueue_script(‘jquery’);

Best regards,
Chuck

Hi Chuck,

Great! I’m glad to hear that helped.

Justin

I’m having a similar issue. this file ‘wp-content/uploads/bb-plugin/cache/####-layout.js’ is being loaded before jquery. I have all JS loading in the footer, but it appears that jQuery is not a dependency for that layout JS.

I did a little digging and it looks like its this line 381 in bb-plugin/classes/class-fl-builder.php
wp_enqueue_script('fl-builder-layout-' . $post_id, $asset_info['js_url'], array(), $asset_ver, true);

I think just adding the dependency there will fix it, but I’m not sure if that will cause other conflicts.

Hi Harvey,

Good catch! Yes, jQuery should be defined as a dependency for the layout.js file. You can go ahead and add it now, I’ll make sure it’s included in the next update.

Thanks,
Justin