The wp-enqueue-script tag has no wiki summary.
0
votes
1answer
12 views
Javascript on Registration Page
I've been trying to figure out how to implement javascript on my registration page with no luck. I've read the documentation on wordpress about properly including js, have searched for relevant ...
-2
votes
0answers
21 views
wp_enqueue_script doesn't work!
Hello there! I am building a wordpress theme and whenever I apply the wp_enqueue_script function into my functions.php file, everything seems to go smoothly, except when I load the page. Here is the ...
0
votes
0answers
14 views
wp_enqueue_script Best Practice [duplicate]
I have this script:
function my_scripts() {
wp_enqueue_script('commonfunctions', child_template_directory . '/script/commonfunctions.js', array('jquery', 'jquery-ui-draggable'), '1.0', true);
if( ...
-1
votes
1answer
18 views
Which jQueryUI handles are predefined in wordpress?
In section 4 of this blog entry jQueryUI is loaded by
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-datepicker', $pluginfolder . ...
-1
votes
0answers
12 views
Enqueue jquery in footer means slideshow images briefly appear on top of each other [closed]
I'm enqueueing jQuery in the footer of a Wordpress theme but when the page loads, for a brief moment, any images contained within a slideshow appear on top of each other
See this link for an example, ...
0
votes
1answer
17 views
Child Theme - what is the scope of overwriting files?
I noticed that creating twentythirteen-child/archive.php overwrites twentythirteen/archive.php but creating twentythirteen-child/shortcodes/drop-cap/drop-cap.php does not overwrite ...
0
votes
1answer
22 views
Modular CSS and JS in Child Themes
Let's assume that twentythirteen/shortcodes/ exists and inside are folders with shortcodes. 1 folder = 1 shortcode. Each shortcode has: 1 PHP file, 1 CSS file, 1 JS file.
...
0
votes
1answer
14 views
Including style.css in Child Theme
Twenty Thirteen uses wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri() ); in functions.php.
Wheter I use it or not use it in twentythirteen-child/functions.php the style.css from Child ...
0
votes
1answer
14 views
Including files in Child Themes
Twenty Thirteen uses the following in functions.php: require( get_template_directory() . '/inc/custom-header.php' );. When I copy /inc/custom-header.php to twentythirteen-child, it isn't replaced. I ...
0
votes
0answers
28 views
jQuery does not enqueue for my purpose… (before an inline script in the footer)
Following How to add a javascript snippet to the footer that requires jQuery
I am trying to load jQuery before my script does stuff but it's not working.
This is it working when I include jQuery ...
1
vote
2answers
34 views
Enqueue never runs
My enqueue scripts are never called I can't figure out why. All my paths are correct and I'm assuming the code is correct
Functions.php
function tim_enqueue_default_scripts() {
if (ENVIRONMENT ...
3
votes
3answers
97 views
Best Practices for Seperating jQuery from HTML/PHP
I am creating several jQuery scripts to help validate forms before they are submitted. I have read that it is best to always separate jQuery scripts into a separate file so that you can load the ...
0
votes
1answer
44 views
Trying to add script to specific admin page is not working
What I am trying to achieve is to load a .js file on an edit.php page, however the code is not working specifically for this page. I've applied the same code type of code to other CPT pages, but for ...
0
votes
2answers
50 views
Enqueue scripts inside a class in a plugin
I have a plugin like this:
<?php
/*
Plugin Name: MyPlugin
*/
class MyPlugin
{
public function __construct()
{
add_action('wp_enqueue_scripts', array($this, 'enqueueAssets'));
}
...
0
votes
1answer
62 views
wp_head() - list hooked actions with priorities?
I'd like to add something to wp_head() but I'm aiming precise location (like after style.css but before rtl.css and before my other custom script). I'm wondering if it's possible to list everything ...
1
vote
2answers
132 views
Load multiple Javascript scripts
I have three Javascript script that I need to load -
imagesLoaded.js
lazyload-1.8.4.js
and cd.js
cd.js contains my functions that use imagesLoaded.js and lazyload-1.8.4.js.
Do load them ...
0
votes
1answer
60 views
Stop a plugins js and css from loading on all pages and show up only where it is called
This plugin has an unique way of registering styles and scripts so I have no idea on how to stop it from loading on all my pages. After a quick search to see where wp_enqueue_style&script is I ...
0
votes
2answers
58 views
Enque Javascript in Footer?
I currently enque jQuery like so - how do I move this to the footer instead?
// Enque: jQuery
if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
function my_jquery_enqueue() ...
1
vote
1answer
58 views
Can't load JS File
I'm trying to load two JS files. But some how its not working. Tried both of these, and the console window doesn't complain of unable to load the file, it never was in the head.
Also, I'm having a ...
0
votes
1answer
42 views
How to enqueue some javascript source once per page
I need my plugin to generate the following - once per page:
<script type="text/javascript" src="https://<ritc url for js file>"></script>
<script type="text/javascript">
...
0
votes
1answer
60 views
Linking wp_enqueue can't find the javascript file (adds “?ver=x.x.x” to the src)
So I'm trying to link in a javascript file the right way, by using this:
--functions.php--
function custom_scripts() {
wp_register_script('myscript','/backdrop.js',array('jquery'));
...
0
votes
2answers
89 views
enqueue_script doesn't work with HTML5 blank theme
I am trying to enqueue a couple of js files using something like this code:
function scripts_function()
{
wp_register_script('mapbox', 'http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.js');
...
0
votes
2answers
37 views
wp_enqueue_scripts hangs
In the following snippet, when I add the wp_enqueue_scripts call, the page freezes.
What am I doing wrong?
function my_enqueue_stuff() {
if ( is_front_page() ) {
wp_enqueue_style('style', ...
0
votes
0answers
31 views
How to load script-related styles automatically?
Scenario: It is common that a JS dependency is bundled with a style file to work properly (just think about your favorite slideshow jQuery plugin). AFAIK, in this situation, the script and style have ...
0
votes
0answers
112 views
How to add vertical navigation from Foundation 3 to a Foundation 4 based theme?
I am trying to add the vertical nav bar from Foundation 3 to a theme using Foundation 4. As an experiment I created a plain html file with Foundation 4's js and css and added the js and css from ...
1
vote
1answer
65 views
Problem with wp_enqueue_scripts in plugin
I've created the following plugin which requires a js library, however attempts to load the plugin with the line add_action( 'wp_enqueue_scripts', 'calc_script' ); in place fail with the error ...
0
votes
0answers
32 views
Is it possible to enqueue the Youtube API script or does it have to be inline?
The code below is the main part of a function in my functions.php which returns a div and script which ultimately output a youtube API iframe to the template where the code had been called from. At ...
0
votes
1answer
47 views
Ordering stylesheet above <style> using functions.php
I'm loading a stylesheet and a style into the header using functions.php. This works but the stylesheet is being presented below the <style>. I need to order the stylesheet above the style ...
0
votes
0answers
50 views
wp_register_script stops wp_enqueue_style working
Ambiguous title, yes. Sorry.
I am using the roots framework to register scripts and stylesheets.
When I include the wp_enqueue_script('main_js'); my style sheets come out as <style media="" ...
-1
votes
1answer
45 views
Errors while Loading Most Recent Version of jQuery
I am trying to set up my WordPress so that it will use the most recent version of jQuery. Here is what I have done so far:
functions.php
<?
add_action( 'wp_enqueue_scripts', 'RegisterJQuery' );
...
2
votes
1answer
53 views
Using get_option() in JavaScript
Previously, I used the get_option() function to get an option in PHP, like this:
$width = get_option('my_width');
This is inside a shortcode function.
Now, I want to have an option in JavaScript. ...
0
votes
1answer
49 views
Enqueueing scripts selectively & activation where needed
If I enqueue my scripts selectively, for instance I have a slider I only want to load on homepage, which is activated in main-js, e.g:
wp_enqueue_script( 'main-js' );
if ( is_front_page() ) {
...
0
votes
0answers
9 views
Strange error when using enqueue jquery scripts in my functions.php [duplicate]
I like to use my own jquery version, and the only way to stop other plugins or wordpress loading in another version of jquery, I use this function below at the top of my functions.php
// JQUERY 1.9.0
...
0
votes
1answer
109 views
loading javascript CDN with local fallback (not jQuery)
I'm trying to modify this to register and enqueue a jQuery plugin from a CDN with local fallback.
However, when the URL fails (or if I give it a fake url) Firebug receives 2 aborted calls to the URL ...
0
votes
1answer
122 views
'jQuery is not defined Error' appearing in load-scripts.php
I'm writing this question having already found a solution, in order to see whether other people have encountered this problem.
I was having a problem on the back end of a site I am building in ...
0
votes
2answers
75 views
Hook 'wp_enqueue_scripts' priority has no effect
In a theme I am working there are up to 3 Stylesheets. I am using the hook 'wp_enqueue_scripts'. The order of the stylesheets is important for overwriting styles.
I have a code like this:
...
0
votes
1answer
92 views
force jQuery to load in the head
I've written a plugin which uses wp_enqueue_script("jquery"); to load jQuery. I need to load jQuery in the head and not at the bottom of the body. However, I think that this command is overwritten by ...
0
votes
1answer
39 views
Possible to enqueue scripts and CSS to Multisite Network dashboard?
Is it possible to enqueue scripts and css only to the Network Admin Dashboard?
To edit the network admin menu, you have this hook: network_admin_menu, so I also tried network_admin_enqueue_scripts, ...
0
votes
2answers
76 views
Adding dependencies to script enqueing
What is the point of the dependencies parameter when using wp_enqueue_script()?
For instance, when I do the following:
wp_enqueue_script(
'jscripts',
get_stylesheet_directory_uri() . ...
0
votes
2answers
254 views
Failing to load my script files in wordpress! i can't figure out what i'm doing wrong
i have customized my .html as a custom wp theme.
i have these scripts in my header.php:
<script type='text/javascript' src="scripts/jquery-1.8.2.js"></script>
<script ...
0
votes
1answer
106 views
Move jQuery to the bottom of the page whilst keeping the WordPress jQuery
I wish to move jQuery to the bottom of the page on my theme, to speed up loading times.
Previously I was doing this by replacing it with Google's CDN version but I have been told that is a bad thing ...
1
vote
1answer
156 views
wp_enqueue_script Doesn't Work?
It's pretty standard, I enqueue script and style for admin page.
function admin_custom(){
wp_enqueue_script('js', plugins_url('adm.js', __FILE__));
wp_enqueue_style('css', ...
1
vote
2answers
45 views
Enqueueing Scripts on a Custom Top-level Menu Page
I've created a menu page using the following function:
add_menu_page(
'Nonpareil options',
'Nonpareil options',
'administrator',
'nonpareil_theme_options',
'nonpareil_theme_display'
);
...
0
votes
1answer
300 views
Override default jquery ui library with newer version
The latest version of jquery ui core fixes a bug that's on my site. The problem is that Wordpress comes with an earlier version.
How do I override the default jquery ui core? One solution I've found ...
0
votes
4answers
87 views
Help to enqueue a js functions ( jquery) [closed]
I have this js function (the textualizer.js is external) but I can't make it works on WordPress. Any help?
I already added
wp_register_script( 'textualizer', WP_THEME_URL . ...
1
vote
1answer
51 views
Enqueue AWS Script
I am working on the integration of an Amazon Webstore (Amazon Checkout) on a WordPress site using Amazon Documentation here. Has been a while since I worked with enqueueing external JScripts. I need ...
2
votes
1answer
220 views
How to combine multiple CSS files and concatenate JavaScripts if WordPress recommends enqueuing them?
How would I go about combining multiple CSS files and concatenating my scripts if they're being enqueued as WordPress recommends? My site is pretty slow and would like to optimize for performance.
0
votes
2answers
35 views
Including Javascript options
For a Wordpress Theme I know javascript files (ending in .js) must be included using wp_enqueue_script in functions.php but how do I include additional javascript code, for example say I need to add ...
1
vote
1answer
156 views
How do I get my page to load the jQuery UI Effects library?
I'm using javascript for the first time to do some simple animations on the home page of my website. So far I have added the following to my header.php file (which is only used for my home page), ...
0
votes
0answers
176 views
Why was wp_enqueue_script was called incorrectly? [closed]
I receive the error:
wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks.
But my code ...

