Why are files enqueued with wp_enqueue_style and wp_enqueue_script 404 Not Found?
You tried to load files from the assets folder, but you made a typo and named the folder assests and didn’t notice
You tried to load files from the assets folder, but you made a typo and named the folder assests and didn’t notice
wp_enqueue_script() and wp_enqueue_style() both use WP_Dependencies::add() which initializes a new instance of _WP_Dependency (see wp_scripts() and wp_styles()), so all the script’s dependencies are stored in the deps property of the class instance. However, that property only stores the handle names of the script’s dependencies, e.g. jquery-migrate and jquery-core for the default/core jQuery script (handle name: … Read more
WP_Script always adds text/javascript to the <script> tag, and applies no filter before it returns, there is not much you can do there. You could try to create a subclass of WP_Scripts that has this functionality. If you change the global $wp_scripts to your new class, this might work.
It should work like this. Sidenotes: I don’t know why you deregister a stylesheet and register it again. Also: get_bloginfo(‘template_directory’) is now replaced by get_template_directory_uri(). Third: Are your folders really named with dots in between? Maybe this causes problems. And maybe your ui stylesheet is an dependency of the main jquery ui stylesheet. You should … Read more
You can use the first one, as long as the scripts have been registered, it will enqueue the dependencies prior if they haven’t already. JQuery etc should already have been registered so version A is perfectly fine
You’re registering/enqueueing your script wrong. You should register/enqueue in your theme’s functions.php file instead of inside the header/page. Also, you need to use your theme’s directory … which will be along the lines of mydomain.com/wp-content/themes/BLANK-Theme/js/SliderViewer-1.2.js. Use this code in functions.php: function my_scripts_enqueue_method() { wp_enqueue_script( ‘SliderViewer’, get_template_directory_uri() . ‘/js/SliderViewer-1.2.js’ ); } add_action( ‘wp_enqueue_scripts’, ‘my_scripts_enqueue_method’ ); This … Read more
While you can practically control order of hooked things by priority, it’s not always the right tool for the job. In case of styles you should be using appropriate wp_enqueue_style() function which allows you to easily set up elaborate dependencies which will be automagically processed by WP to produce desired order of styles output. Unfortunately … Read more
get_stylesheet_uri will return the current theme’s stylesheet– the child stylesheet if it is a child theme. While not entirely clear from the Codex entry for that function, it is clear from the entry for get_stylesheet_directory_uri, which is used by get_stylesheet_uri. What should be happening is that the child stylesheet is being enqueued twice under different … Read more
You got parentheses levels slightly wrong and that broke your callbacks. It should be: add_action( ‘wp_enqueue_scripts’, array( __CLASS__, ‘frontend_enqueues’ ), 1 );
You don’t need to register it but in your own js file, replace the first $ to jQuery. jQuery is loaded in No Conflict Mode jQuery(document).ready(function($) { // Your code here. Use $ as normal. }); And if you use anonymous functions, do it like this (function($) { // Your code here. Use $ as … Read more