javascript not loading in wordpress
Problem was a simple misspelling. The add_action should be add_action (‘wp_enqueue_scripts’, ‘theme_add_cycle_slide’ ); I wrote ‘script’
Problem was a simple misspelling. The add_action should be add_action (‘wp_enqueue_scripts’, ‘theme_add_cycle_slide’ ); I wrote ‘script’
Of course it’s possible. Galleria is a jQuery plugin that is similar, but better (fancy slide transition effects and more). You could include it yourself (see their documentation) or if you prefer WordPress plugins look at Photo Gallery which seems like it’s based on galleria (haven’t tried it). Another really popular gallery plugin is the … Read more
you should place your Javascript files in a subfolder of your theme rather than adding folders to the base structure of WP.
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
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
The following code is trying to use jQuery before the jQuery library is loaded. Hard to say exactly where it is coming from, but it seems related to your form. If that is a custom form, maybe check in your theme’s header.php? It is definitely not being enqueued properly and so I would guess it … Read more
Your code looks fine and should work. So that leads to the conclusion that jquery is not loaded at the time you are trying to load your script. Since WP is loading jquery by default, this leaves two possibilities: You are loading your script before jquery is loaded with a high priority on you add_action … Read more
I had the same problem and didn’t find the answer. But I also find a solution without JavaScript. You can do tabs only with CSS+HTML. It is something like: CSS: <style type=”text/css”> #tabs div { width: 200px; padding: 25px 0; margin: 0; position: relative; } #contents div { display: none; position: absolute; left: 200px; top: … Read more
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
“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.