Tag Info

Hot answers tagged

2

Wordpress has essentially two groups of methods to handle scripts, both of which should be used: wp_register_script Registers a script in Wordpress. It does not get called, it is just available for Wordpress, if it is needed. wp_deregister_script is the exact opposite. It deletes the definitions made in wp_register_script, the script is no longer ...


2

Just to chip in,first of all, thanks for the complement, appreciated. You are using a child theme, of which the parent theme should have enqueued the jquery library built into wordpress. Like I said in the post you are refering to, it is bad practice, my emphasis, for any parent theme to not enqueue jquery by default. You have a couple of problems with ...


2

This is not possible the way you think. It would maybe be possible if you use Reflections or debug_backtrace(), but there's no reliable way to do this. WordPress does not keep a stack or queue where it tracks file names. The only thing I could imagine is just hooking into the action and inside wp_enqueue_scripts(): wp_enqueue_scripts and attach a ...


2

I have checked your site jQuery migrate is not enqueued as the version of jquery enqueued is 1.8.3 and jquery migrate only works with jquery version above 1.9 Probably your version of wordpress in not the latest one . The version of preetyphoto is outdated too you can use the latest version ...


1

Something is messing up your queue. Your jQuery URL has 1.8.3 version, while that is neither default in WP 3.9.1 or actual file it points to (1.11.0). Migrate is not showing up for me either, likely because of issues there. Effectively you are missing jQuery.browser because it was removed in version 1.9+ and migrate is not loaded.


1

A couple issues here... First, the init hook is too early for WordPress to know which page template you're going to be using. (So the is_page_template() function will always return false). Just go ahead and hook your function to wp_enqueue_scripts (which you're probably already doing for your global CSS / JavaScript). And then check for the page template ...


1

wp_register_script() just adds an entry to an array, it doesn’t do anything resource intensive. See WP_Dependencies::add(). Registering scripts early helps to avoid collisions, so you should do that always on wp_loaded.



Only top voted, non community-wiki answers of a minimum length are eligible