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

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
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
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
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 ...
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 ...
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 ...
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
248 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/ ...
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
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
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 ...
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. ...
0
votes
0answers
57 views

Remove “enqueued” script from array

Im working on optimizing a child theme for a site and the parent "has more than we need" Lots of requests being generated all adds up to performance hits. What I'm trying to accomplish is this effect ...
4
votes
2answers
171 views

How to echo JS right after enqueued script to put it into noConflict mode?

I want to include and use third party JavaScript file (Bootstrap Tooltip) in my plugin. Since Bootstrap is highly popular framework and tooltip() is rather generic name I want to make use of included ...
4
votes
4answers
267 views

Include jQuery UI as a whole

Is it possible to include jQuery UI as a whole instead of: wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('jquery-effects-core'); // a lot of other jquery ui imports.... I've searched in ...
1
vote
1answer
317 views

Enqueue Google CDN jQuery in Footer

I'm trying to enqueue jQuery from Google's CDN and have it called in the footer rather than the header of my theme. Here's my code: wp_deregister_script('jquery'); wp_enqueue_script('jquery', "http" ...
0
votes
1answer
29 views

Wordpress include scripts and style in plugin page

I am working on a Wordpress plugin where I want to include some jquery scripts and stylesheet. I found dit piece of code in an article and this should do the job, but it doesn't work for me. Can ...
0
votes
1answer
75 views

Ajax navigation and scripts loaded only on certain pages

I'm building a theme. The theme post navigation is done through jQuery Ajax. I've been several plugins to see compatibility and I have a problem with the Ajax functionallity. Some plugins such as ...
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' => '', ), ...
0
votes
0answers
110 views

JS enqueue path (localhost)

Im trying to load the flexslider.ls file in the footer of frontpage, it just loaded Jquery only, without flexsilder.js I tried through full path // Load the Theme JS function theme_js() { ...
0
votes
0answers
71 views

Clarify: Enqueueing scripts within shortcode only loads in footer?

Each time I enqueue scripts inside the shortcode handler, it ends up in the footer. It doesn't matter whether I register them first and set it to load in the header, if I enqueue inside the shortcode ...
1
vote
1answer
74 views

Enqueue Wordpress plugin scripts below all other JS

I am developing a simple Wordpress app but I am having an issue as all of the plugin scripts are rendered before those which are enqueued in my functions.php. Here is a sample section of the ...
0
votes
1answer
68 views

How do you load js and style resources from CDN with local fallback using wp_enqueue_scripts?

I had a hard time finding the correct way to do this. I want to load the CDN resources here: http://www.bootstrapcdn.com/ but use wp_enqueue_scripts and have local fallback. This is the method I am ...
2
votes
1answer
58 views

How to control the order of the combination of enqueued styles and scripts - site speed issue

We know, using wp_head() and wp_footer() all the scripts and styles are enqueued using wp_enqueue_styles and wp_enqueue_scripts hook. What we do is to enqueue our stylesheets and scripts using ...
0
votes
0answers
140 views

Plugins enqueuing jquery in head

I am trying to optimise my site for mobile and enqueued my scripts to be placed in the footer so as to eliminate render-blocking javascript in above the fold content. Unfortunately some of the plugins ...
0
votes
1answer
98 views

Can't see why my scripts aren't loading when I register and enqueue them

I'm trying to replace "hardcoded" calls in my header.php by registering and enqueueing them in functions.php. JQuery 1.8.3 loads as desired, but the other scripts don't. Here's what I'm using: ...
-3
votes
1answer
76 views

Trying to use wp_register_script/style and enqueu them from an array - getting an error [duplicate]

here is what i got so far: // my array $this->headersArray = array( array('handle' => 'buy_mobile_funcs', 'src' => 'jsFunctions', 'extention' => 'js', 'deps' => '', 'media' => ...
1
vote
0answers
15 views

How to enqueue script or style in a theme's template file? [duplicate]

I am making a template for the page which will contain a slider. Can anyone share some advice with me of how to go about it?
1
vote
1answer
55 views

wp_enqueue_scripts wont load my scripts

I am trying to add my custom scripts to my project but can seem to get them to load. I've never had this issue and am stumped. This is what I have in my functions.php: function ex_scripts() { ...
9
votes
3answers
853 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
0answers
277 views

wp_enqueue_script() doesn't work with AJAX

My problem is: I made an AJAX call using this code wp_enqueue_script( 'prefix-myscript-name', plugins_url( 'js/ajaxcall.js', __FILE__ ) ); I made the call and the AJAX just going fine. I used this ...
0
votes
1answer
160 views

Issues with wp_enqueue_script and jquery-ui

wp_enqueue_script('jquery-effects-shake'); ..doesn't seem to work, no matter where I put it. I've tried the following and lots of googling: function my_callback() { ...
0
votes
2answers
852 views

jQuery code not working when included in functions.php

I feel like I am definitely missing something simple here... but for the life of me, can't find what I'm missing. I am of the "bad habit" of including jQuery functions directly in the header.php file ...
0
votes
1answer
41 views

Enqueue scripts based on options

What is the best method to enqueue scripts based on options I have? Let's say I have 50 options and for each I need to enqueue a script(some of them might repeat.). Can I have any ...
1
vote
1answer
220 views

How to run a external JavaScript file on wp-admin if admin, and other if normal user?

I'm new to WordPress plugins, and I'm trying to load a external JS/jQuery file with some scripts I need. It needs to run in the wp-admin page (not just once when activated). There is a JS file for a ...
0
votes
2answers
449 views

Deregister scripts on unnecessary pages using remove_action

To all would-be close-voters: This question is not a duplicate, because I need to remove all scripts added by plugin using remove_action. In Very stubborn wp_register_script / add_action vs ...
0
votes
1answer
102 views

Very stubborn wp_register_script / add_action vs remove

I am trying to get rid of a plugin's .js file in the but it's not working. It's being called here {partial code): class awqsf{ const post_type = 'awqsf'; function __construct(){ // ...
6
votes
1answer
140 views

Register a script to be enqueued both in admin and front end

As i understand it, admin scripts are supposed to be registered and enqueued through the admin_enqueue_scripts hook and all other scripts at wp_enqueue_scripts so i have set up the following functions ...
1
vote
1answer
113 views

Where to call wp_enqueue_script in a plugin with custom template?

I am writing my first plugin and I have this code in the main plugin php to replace home page with custom template add_filter( 'template_include', 'replace_home_page' ); function replace_home_page( ...