Can’t get jQuery to enqueue into post edit script

Use the admin_enqueue_scripts hook to add your own custom script. Put it in an external file, and use wp_localize_script to pass any data from php to javascript. jQuery is already used on the admin side, adding a script tag sourcing it from google will break things. function wpa80418_admin_enqueue( $hook ) { if( ‘post.php’ != $hook … Read more

Hook with jquery script is not working in wp-admin [closed]

The blank page is a PHP fatal error. You need to either escape the single quotes or change them to double quotes. $(e.target).prop(‘checked’, false); -> $(e.target).prop(“checked”, false); You can enable debugging in WordPress to see the PHP errors by setting WP_DEBUG to true in you wp-config.php file. You can also look in your server/PHP error … Read more

How to fire jQuery after $(window).on(‘load’)

It likely does not have to do with WordPress Core – in most cases this type of issue comes about when plugins conflict. I would suggest deactivating all your other plugins and trying a default theme, a la Twenty Seventeen. If it works at that point, you can switch the theme & test, then activate … Read more

Why won’t this jQuery work in WordPress?

“Won’t work” doesn’t say much. Use Firebug with Firefox, or in Chrome or Safari or IE8, use the developer tools to check for JS errors on your site. WP3.2 now includes jQuery 1.6 and your jsfiddle example uses 1.4, so there’s a possible conflict.

jQuery to work on WP custom page template

Probably there are a lot of questions/answers here in wpse that explain this kind of issues and the use of jquery and other js in wordpress. However, In wordpress never put javascripts in template files. Javascript should be in separate .js files. The javascript should be putted in the templates using wp_register_script / wp_enqueue_script functions … Read more