jQuery will not work on page from snippet or file
The file was reading from parent theme directory not the child theme directory thus the issue of it not being read. Found it from tracing the directory from the Network tab
The file was reading from parent theme directory not the child theme directory thus the issue of it not being read. Found it from tracing the directory from the Network tab
You can’t do that way first you need to enqueue your script using : wp_enqueue_script(‘jquery’); wp_enqueue_script(‘ns-likes-dislikes-for-posts-js’, plugin_dir_url(__FILE__). ‘path/to/your/js/file/from/plugin/directory/custom.js’, array(‘jquery’), ‘1.0’, true); in custom js start writing your js with jquery but you can’t use $, instead use jQuery. if you want to use $ instead of jQuery try this code: (function($){ // enjoy jquery with … Read more
If the input is disabled, it is ignored during form submission. You can try to use readonly attribute. As it says in the docs: The difference between disabled and readonly is that read-only controls can still function and are still focusable, whereas disabled controls can not receive focus and are not submitted with the form … Read more
This way of wokring with slides seems to be as popular as it is terrible… 🙂 I coded something very much like this recently. Basic idea, adjust as needed: $id = get_the_ID(); $slides = array(); $i = 1; foreach( get_post_custom_keys( $id ) as $key ) if ( false !== strpos( $key, ‘slide’ ) ) $slides[$key] … Read more
First off — When including Javascript, use a function hooked to the init action in functions.php. See: http://scribu.net/wordpress/optimal-script-loading.html Secondly — The CSS for the BP bar is being effected by something in your theme. If fixing how your Javascript is loading first doesn’t fix that issue, try selecting that object in Firebug (Or Chrome’s developer … Read more
So if you say there are no errors, I’m assumming that your problem is the AJAX request changing the DOM, and your scripts being loaded before that. If the document changes, you’ll need to tell your scripts that, so they will fire their events on the new content. So: Either you reload all scripts again … Read more
if (getCookie($(this).attr(“id”)) == true) { The above code will NEVER evaluate as true because cookie values are stored as strings. You are trying to store a boolean value, which is converted to a string when it is written to the cookie. When the browser reads the cookie value, it is also read as a string. … Read more
Make sure you’re not accidentally loading jQuery 1.5.0 from somewhere like Google’s CDN or something. jQuery 1.5.0 is not backwards compatible, and the timing of its release prevented it from making it into WordPress 3.1.
To replace the default jQuery url, do: wp_deregister_script( ‘jquery’ ); wp_register_script( ‘jquery’, ‘your custom url’, … ); Then call wp_enqueue_script( ‘jquery’ ); as usual. Note that various pages in the WP admin might not be compatible with never versions of jQuery, not to mention plugin scripts.
Even after listening to the podcast this morning where Joel and Jeff talk about how “Fix my Code” questions are too localized to benefit the community and serve no purpose to anyone but the op, I’m going to try and answer this in a way that will be useful and beneficial to other weary WordPressors … Read more