FullCalendar in WordPress is not working

You page is generating two errors: Uncaught TypeError: undefined is not a function. This is likely due to the fact that WordPress sets jQuery to NoConflict mode. Your script is using the $ shortcut and is failing. Modify your script accordingly, either replacing the shortcut or wrapping the jQuery. https://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_Wrappers

scripts not loading

You should enqueue scripts in functions.php itself with wp_enqueue_scripts hook. Like this. function my_jsfile() { wp_register_script( ‘menu’, get_template_directory_uri() . ‘/js/menu-effect.js’, array() ); wp_register_script( ‘thumbnail’, get_template_directory_uri() . ‘/js/thumbnail-effect.js’, array() ); wp_enqueue_script( ‘menu’ ); wp_enqueue_script( ‘thumbnail’ ); } add_action( ‘wp_enqueue_scripts’, ‘my_jsfile’ ); And also you should remove wp_enqueue_script from header.php as well as script links. And finally … Read more

video.js not enqueueing?

It could be a couple of things: video.js doesn’t exist at get_template_directory_uri().’/js/video.js’ WP isn’t recognizing modernizr as a registered script, so it won’t enqueue video-js A couple of things to try/research: Is there any plugin already registering a script named modernizr and/or video-js? Try registering (not enqueueing) modernizr within your lw_scripts_10 like so: function lw_scripts_10() … Read more

Deregister scripts from plugin

There’s a much better and more reliable way than naming your plugin “ZZ” – use a delayed hook on plugins_loaded, which fires after all plugins are loaded: function wpse_191178_plugins_loaded() { // Do your stuff } add_action( ‘plugins_loaded’, ‘wpse_191178_plugins_loaded’, 100 );

Including Styles and JS files to work ON my plugin interface

Well after a bit of better searching i found the answer, function my_enqueue($hook) { if ( ‘settings_page_data-layer-management’ != $hook ) { return; } wp_enqueue_script( ‘my_custom_script’, plugins_url( ‘js/dlm-window.js’, __FILE__ )); } add_action( ‘admin_enqueue_scripts’, ‘my_enqueue’ ); to explain just incase anyone has this issue. what i had earlier was a ‘front-end’ hook which is just wp_enqueue_scripts for … Read more

Load stylesheet on custom admin submenu page

Ok, I figured it out: If it’s a submenu page, the $hook looks like this: appearance_page_page-name instead of going by URL. So the complete code would be this: function my_function($hook) { if ( ‘appearance_page_page-name’ != $hook ) { return; } wp_enqueue_style( ‘custom-style’, get_template_directory_uri() . ‘custom-page/style.css’ ); } add_action( ‘admin_enqueue_scripts’, ‘my_function’ );

Can’t execute jQuery before my script

Try two things – 1. Link your js using wp_enqueue_script action as under : add_action( ‘wp_enqueue_scripts’, ‘theme_name_scripts’ ); function theme_name_scripts() { wp_enqueue_script( ‘script-name’, get_template_directory_uri() . ‘/js/example.js’, array(‘jquery’), ”, true); } Third parameter in wp_enqueue_script() function will make sure jquery is loaded before your current js file. Inside your js file, replace $ with jQuery as … Read more