Links a script file to the generated page at the right time according to the script dependencies, if the script has not been already included and if all the dependencies have been registered. You could either link a script with a handle previously registered using the wp_register_script() function, ...

learn more… | top users | synonyms

1
vote
0answers
39 views

How to modify default controls in Wordpress theme customizer

I'm trying modify the default control in the wordpress theme customizer specifically the action for the close button. By default clicking it will make you go back to the themes page, but I want it to ...
0
votes
1answer
41 views

Incorrect filenames in load-scripts.php parameters

I'm attempting to load the media upload js file in a widget. The code works on my development machine and on the staging site but not on the live server. The error I get is that wp.media is undefined. ...
3
votes
3answers
3k views

Adding jquery and thickbox to WordPress theme

I would like to add thickbox for the template which I develop to WordPress. At this time I'm trying with a clean template that have only header.php, footer.php,index.php, and functions.php. I've ...
0
votes
1answer
24 views

Wp_deregister_script() doesn't work

Somewhere in the parent theme for which I'm creating a child theme, the following line is executed: wp_enqueue_script('quovolver', get_template_directory_uri() . ...
0
votes
3answers
176 views

scripts not enqueueing

I have been beating my head against this for a couple of hours now and can't seem to figure it out. I am trying to enqueue a script into my page with the following code in my functions.php. function ...
5
votes
7answers
5k views

wp_enqueue_script adding conditional statement not working

This is the code im using in my functions file: add_action('init', 'sort_out_jquery_pngfix_frontend'); function sort_out_jquery_pngfix_frontend() { global $wp_scripts; if(!is_admin()) { ...
0
votes
2answers
39 views

add jquery file if a certain page is included

I was wondering if anyone could help my by explaining if it is possible to enqueue a javascript file only if for example homepage.php is included. what i have tried to do inside homepage.php: class ...
1
vote
1answer
50 views

Enqueue Wordpress jQuery after it's been deregistered by a plugin

I'm looking after a Wordpress install that makes use of a plugin that deregisters jQuery and replaces it with it's own ancient version. I'm aware of why loading your own jQuery is irresponsible and ...
0
votes
2answers
127 views

enqueue_scripts() in child theme doesn't work

I'm trying to enqueue my "scripts.js" located at the root folder of my child theme. I don't understand why the following code (located in "functions.php") doesn't work: function enqueue_scripts() { ...
0
votes
2answers
98 views

wp_enqueue_scripts hook is not being called

I added the following code to my functions.php: if(!function_exists('bi_frontend_scripts')) { function bi_frontend_scripts() { wp_enqueue_script('jquery'); // I originally wanted ...
0
votes
1answer
95 views

How do I enqueue a js file in functions.php for a if lt IE 9 statement? [duplicate]

I'm coding a theme that uses the Twitter Bootstrap 3 files and in the header I want to include: <!--[if lt IE 9]> <script src="<?php echo get_stylesheet_directory_uri(); ...
0
votes
2answers
169 views

Enqueue script inside IE conditional comments

I'm trying to include selectivizr.js inside conditional comments. What am I doing wrong here? <!DOCTYPE html> <html class="no-js" <?php language_attributes(); ?>> <head> ...
0
votes
1answer
32 views

jQuery does not appear to be enqueued on static homepage

I have been searching why, but I am clueless, I cannot figure out what is happening... jQuery does not appear to be enqueued on static homepage (I am not used to work with static homepages). On ...
0
votes
1answer
376 views

'Bones' theme: Load stock scripts in footer instead of header?

I'm using the 'Bones' theme in my latest WordPress site, and when I run the site through Google PageSpeed, I receive the following error: Eliminate render-blocking JavaScript and CSS in ...
0
votes
0answers
31 views

jquery-ui-autocomplete not loaded

I am using Advanced Custom Fields for a registration form on Classipress and I have indicated that the Business Name, First Name, Last Name and Type of owner are required fields. However, when I ...
9
votes
3answers
855 views

Is it possible to use wp_localize_script to create global JS variables without a specific script handle?

Can we somehow use wp_localize_script() to create global js variables without a specific script handle which can be accessed from all the js files, even if the js scripts are not enqueued properly by ...
0
votes
2answers
100 views

When does WordPress automatically enqueue jQuery?

I understood that WordPress ALWAYS enqueues jQuery on all themes, thus it's reduntant to enqueue another jQuery with the same version. However, while developing a theme, for testing purposes I moved ...
6
votes
2answers
219 views

How can I use the built in Wordpress “browse link” functionality?

I'm coding a widget and I'd like the user to be able to pick a link like you can when editing a regular posts or page (when you click on the little link icon and you get the AJAX search functionality ...
1
vote
1answer
97 views

How do I make sure a plugin loads a script after jQuery

My client has a site running the latest version of WordPress, with Thesis. Currently, jQuery is being loaded in the footer, as the very last script to be loaded. I'm not sure what is causing jQuery ...
0
votes
1answer
358 views

WOW.js Script Tag Initialization Header/Footer

hope things are going well. I'm attempting to use WOW.js http://mynameismatthieu.com/WOW/docs.html with animate.css to add animations to my site. WOW.js requires me to initialize it by adding the ...
1
vote
2answers
215 views

enqueue script only if it is not already enqueue

I want to include a script in a shortcode output, so I am trying this: function my_shortcode( $atts, $content = null ) { extract(shortcode_atts(array( 'title' => '', ), ...
-3
votes
2answers
302 views

Why does wp_enqueue_script ignore my 'wp_head' hook?

I would like css_head_scripts and js_head_scripts to be appended to wp-head but Wordpress completely ignores it? Am I missing something? function css_head_scripts() { wp_enqueue_style( ...
0
votes
2answers
121 views

call my script only after loading UI library?

i want to add small effect (UI-jquery-draggable) to the navigation buttons in one of the WP slider plugins. what i did: 1 I have installed the slider plugin 2 know that UI is allredy registerd in ...
0
votes
3answers
203 views

Asset loading with gulp.js or Grunt

I just started using gulp.js which is a task runner like Grunt and a lot of the sites I work on are using WordPress so I was wondering if anyone has some ideas about how to use the combined scripts ...
0
votes
0answers
9 views

Javascript not bring used in 3.8 [duplicate]

I'm getting an issue on http://bollywoodbang.ca/wp/, it appears that my javascript files aren't working. I called them in functions.php using wp_enqueue_script(), and in the inspector says that the ...
0
votes
2answers
19 views

is there a way to get all queued scripts/styles into a template without `get_header()`?

in my main plugin page i check if a certain page is visited if so, i load a certain template. in the following way: add_filter( 'template_include', array($this, 'includeTemplate'), 99 ); public ...
0
votes
0answers
38 views

Scripts only working on home page

I am using the following example code to enqueue several scripts.. add_action( 'wp_enqueue_scripts', 'my_scripts' ); function my_scripts() { wp_enqueue_script( 'jQuery-Main', ...
0
votes
0answers
780 views

Uncaught TypeError: Object [object Object] has no method 'dialog'

I have a project in WordPress. I am trying to implement dialog box popup on click of hyperlink. On click of this link, function shownm1() is called which is placed in .js file. The function contains ...
0
votes
3answers
1k views

Loading scripts & styles from a meta box callback function

Case: I got a set of classes that build form fields based on data from an input array. The class can build the following types of form fields: input (basic, hidden, password) textarea radio ...
1
vote
1answer
92 views

Image LazyLoad plugin not loading jQuery dependancies with wp_enqueue_script in WP 3.3.1

I am attempting to install the image LazyLoad plugin with use on my Wordpress 3.3.1 blog. I have followed the basic instructions, so it is installed and activated on my development site. The ...
0
votes
0answers
97 views

Including Older Version of jQuery for IE7/IE8

I realise jQuery 2.0 dropped support for some browsers including IE7 and IE8. I'm only using a bit of jQuery on my WordPress site, but since I need to support IE7/IE8, I was wondering what the best ...
0
votes
1answer
58 views

How to enqueue javascript for WP Customize options sidebar?

I'm trying to add Chosen.jquery to the WP Customize options panel, so I can have an autocomplete box there. Is there any way I can do that? I tried with admin_init, admin_footer and ...
8
votes
1answer
5k views

How to add defer=“defer” tag in plugin javascripts?

I couldn't add defer tag in plugin javascripts. Google developer pagespeed test suggests me to add defer tag in contact form 7 javascripts. This is how contact form 7 includes javascript in header. ...
0
votes
1answer
128 views

Object [object Object] has no method 'slides'

I am using the enqueue function to link two javascript files. I get this error Object [object Object] has no method 'slides' I checked and I am not loading jquery more than once. The code that is ...
0
votes
0answers
68 views

get_template_directory_uri() gives me wrong path when I try to use wp_enqueue_style

In my functions.php I use wp_enqueue_style and wp_enqueue_script as I read this is the correct way to add stylesheets and scripts to pages. But as my host has this sub folder where the install goes ...
0
votes
2answers
97 views

Why I can't load my JavaScripts using an hook inside my functions.php file?

I am pretty new in WP (I came from Joomla) and I have the following problem: I am carrying this pure HTML theme (that use BootStrap CSS framework) into a WordPress theme. This is the original pure ...
0
votes
0answers
39 views

Make plugin page follow standard enqueueing procedures

I am writing an administrator plugin that helps a user write some simple shortcodes. When the user clicks on a new button in the TinyMCE editor a ThickBox window appears and loads a PHP template I ...
1
vote
0answers
53 views

Dequeue script conditonnally

Was thinking about this : dequeue or enqueue scripts with IE for example. They say we can use global $is_IE; but that's wrong simply because it's not compatible with caching. Nowadays cache is ...
4
votes
2answers
249 views

Why I can't add a CSS style in this WordPress theme?

I am trying to add a CSS style to a WordPress theme that I am developing as is shown in this tutorial: http://www.wpbeginner.com/wp-tutorials/how-to-properly-add-javascripts-and-styles-in-wordpress/ ...
2
votes
3answers
1k views

Enqueue script only for IE

I want to use dd belatedpng so the PNG's on my website appear properly on IE. The script I've always used on non-wordpress websites was <!--[if lt IE 7 ]> <script ...
0
votes
1answer
346 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
2answers
181 views

How to execute a simple php script in WP (I don't think wp_enque_script applies here)

I have a wordpress page where I want to include a budget calculation tool. This budget calculation tool is of course tied to a php script that executes the fields in the budget calculation tool. This ...
0
votes
2answers
45 views

Plugin Scripts no loading on options page

I've got this in my main php file, but the scripts aren't loading function class_table_scripts() { wp_register_script( 'JavaScript1', plugins_url('js/wcs.js'), array() ); wp_register_script( ...
0
votes
1answer
215 views

Dynamic wp_enqueue_scripts?

Is it possible to call wp_enqueue_scripts dynamically? For example, I want to use in function.php my own function addThemeJS( true, 'modernizr', THEME_JS_DIR . "/plugins/modernizr.custom.js", ...
0
votes
1answer
114 views

Why does get_template_directory_uri() not include “www”, only for enqueued stylesheets?

My site's url is set up to include www in settings -> general. I also put it at the very top of my functions.php: update_option('siteurl','http://www.federal-lawyer.com'); ...
1
vote
1answer
34 views

Not sure if enqueuing js scripts properly

When I put this code right above the closing of my body tag it works, but when I try to enqueue it, it breaks. I'm thinking maybe jQuery isn't getting called? The snippet is from here FUNCTIONS.PHP ...
6
votes
2answers
4k views

Load a script just to custom post type in admin

I have created a custom post type "portfolio" with something like this : $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => ...
0
votes
1answer
38 views

Registering / Enqueing Scripts Not Working

Does this look correct and would there be any reason why this isn't working? In functions.php... /** * Enqueue scripts and styles */ function dcp_custom_scripts() { wp_register_script('expand', ...
0
votes
0answers
15 views

Worth enqueue_scripts for mobile via is_mobile? [duplicate]

Is it worth loading the JS for i dunno turning on a responsive menu via the is_mobile conditional? As technically its only going to be used on a mobile device, would it be good practice or improve ...
0
votes
0answers
60 views

how to remove scripts loaded in the footer

Is it possible to remove scripts that are loaded in the footer in wordpress? I currently have the code that works for scripts but only for the one's that are added in the header via wp_enqueue_script. ...