The wp-enqueue-script tag has no wiki summary.
1
vote
1answer
47 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 ...
1
vote
2answers
124 views
Adding scripts to admin page in my theme
In functions.php of my theme I have code to add page in admin area and append scripts to it. But scripts are not loaded. Bellow is code. Commented out add_action lines are the one I did check.
// ...
1
vote
1answer
213 views
Which action to hook wp_enqueue_script to? wp_head or wp_enqueue_scripts? [duplicate]
Possible Duplicate:
Where is the right place to register/enqueue scripts & styles
According to wp_enqueue_script() documentation in Codex, it seems that one should hook ...
1
vote
2answers
126 views
Script won't load via plugin class
I'm not sure why this script is not loading or producing any load errors via Firebug. Here is my plugin script:
class AV_Slideshow{
function __construct(){
$this->hooks();
}
function ...
1
vote
2answers
82 views
Enqueue scripts to a specific header-<name>.php?
I've multiple header files (header-name.php), they are mainly being used by different custom post types.
Is there any way to enqueue script to only a specific header?
At this moment I'm targeting it ...
1
vote
2answers
86 views
Making a plugin only available on the front-end for the logged in super admin
I made a little plugin that enqueues 1 .js file and 1 .css file into a theme's front-end. All it does it load a grid on top of the theme so I can visualise the design.
If this plugin was activated ...
1
vote
1answer
184 views
Help with enqueing scripts in footer after init action
In my functions.php, I have set a register_scripts() and load_scripts(), and hooked them to the 'init' action.
I have registered all the scripts to be loaded in the footer, in order to optimize page ...
1
vote
1answer
349 views
Is there a way to list all the JavaScript scripts that are actually loaded by WordPress? Do we care?
This page on the Codex gives us a list of all the default scripts that ship with WP. But how do we know which ones are actually being used so we don't have to manually enqueue them? Or do we care, and ...
1
vote
1answer
157 views
Execute script only on certain admin pages
To solve this problem i've used this in my js file:
var location = String(window.location);
//only runs in post.php and post-new.php
if(location.search('post.php') != -1 || ...
1
vote
2answers
1k views
jQuery UI AutoComplete & wp_enqueue_script
I looked at the included scripts in WordPress (wp_enqueue_script) and didnt find what I should include to use jQuery UI Autocomplete
I am using it in the admin area. Should I just include jQuery UI ...
1
vote
3answers
264 views
Adding a Javascript slideshow to the home page
I'm trying to add a Javascript slide show to my WordPress home page. In my theme folder I have a js folder and then in that I have jquery.cross-slide.min.js and jquery.min.js.
This is what I have and ...
1
vote
1answer
51 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 ...
1
vote
0answers
122 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
1answer
89 views
issues with wp_enqueue_script in my plugin
So I am working on a plugin and am trying to trigger a js file whenever a post is saved. I have been reading up on this all morning and cannot seem to find why this is not working. Any advice? If I ...
1
vote
1answer
206 views
Check if page/post has any anchors that link to an image jpg/gif/png
What I'm aiming to do is add fancybox to a site I'm developing, but I only want to enqueue the JS/CSS etc if the page/post needs it.
My thoughts are that I would need to check all the anchor tags on ...
1
vote
2answers
309 views
Enqueue script from widget method (of extended WP_widget object) possible? (slightly different from other variations of this question)
I am creating a widget plugin that a user could potentially use multiple iterations of the widget multiple times on a single widget-area / multiple widget-areas on a single page. Because of its ...
1
vote
0answers
188 views
How to correctly make admin pages for custom tables which don't show in the menu? [closed]
I have to create a custom table to store data for a client because they want a very precise search capability. I already have this working with custom post types and using custom fields, but with 800+ ...
0
votes
3answers
971 views
How to enqueue jquery in admin and why is it not already there?
Why does the jquery below not fire? Its going to the "else" every time.
if ( is_admin() && $pagenow == 'theme-install.php' && $_GET['tab']=="upload"){
...
0
votes
1answer
47 views
why quotes shown in Wordpress?
I have written a function to register a script in the admin interface.
function custom_admin_js() {
$url = get_bloginfo('template_directory') . '/admin/admin.js';
echo '<script ...
0
votes
2answers
46 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() ...
0
votes
4answers
80 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 . ...
0
votes
3answers
290 views
What can I hook into after_setup_theme?
I'm wondering what can I or should I NOT hook to after_setup_theme? I'm wondering because I have been told that I shouldn't hook wp_enqueue_style to it, but I have seen other places using it to hook ...
0
votes
2answers
821 views
wp enqueue style on specific page templates
I am in the process of a theme, I would like to add landing pages using page-templates. I cannot find anywhere that shows how to enqueue style or js for specific page templates. Any suggestions.
Ex. ...
0
votes
2answers
109 views
JavaScript enque stopped working
Somewhere along the line I have messed up my js enqueue I am not sure how. I have the following in my functions.php file and I am including <?php wp_footer(); ?> in my footer.php before the js ...
0
votes
1answer
197 views
wp_enqueue_script not loading my custom js file
I am using the following code below in my functions.php, However app.js is not found when I inspect it in the resources tab.
It is looking for it in ...
0
votes
3answers
783 views
wp_enqueue_script and wp_register_script in theme not working
I am trying to use a self written script for the jQuery library in my self-made theme, but it's not working. When I simply use script-tags, everything is alright. So it has to be something with ...
0
votes
2answers
81 views
Trying to get custom js files in my admin header
I'm trying to add a java script file to my admin header and use admin-ajax.php to use ajax in my wp-admin (still learning a lot about the process). I've created a custom folder in my ...
0
votes
1answer
379 views
Cannot enqueue jQuery correctly using Google CDN
The problem:
I understand how to regularly enqueue jQuery UI in functions.php.
My problem is that I'm using a selectmenu widget that doesn't come with WordPress by default:
...
0
votes
1answer
179 views
wp_enqueue_script before wp_head
If this works (and it's the way people do in a bunch of themes around the web):
<html>
<head>
<!-- stuff -->
<?php wp_enqueue_script('jquery'); ?>
<?php ...
0
votes
1answer
137 views
Plugins loading multiple copies of JQuery
I'm having issues where multiple copies of jQuery are being loaded onto the page via plugins that require jQuery.
I Just want to confirm that if I have 3 plugins active on my page, that all properly ...
0
votes
1answer
1k views
How do I make script load after jquery?
function load_my_script(){
wp_register_script( 'my_script', get_template_directory_uri() . '/js/myscript.js', 'jquery' );
wp_enqueue_script( 'my_script', 'jquery');
}
add_action('wp_enqueue_scripts', ...
0
votes
3answers
636 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
...
0
votes
1answer
416 views
Yoast SEO breaking media upload
I have a very simple site that I've modified a very small amount. After installing the Yoast SEO plugin I found that it broke the in post media attach/upload. I'm about 80% sure it's related to Jquery ...
0
votes
2answers
1k views
How do I get a child theme to load scripts from the parent theme?
Pretty new to WordPress functions, so apologies if this is basic stuff.
I've designed a parent theme that registers and enqueues two scripts like so:
if ( !function_exists( 'scherzo_scripts' ) ) ...
0
votes
2answers
377 views
Use of CONSTANT in wp_enqueue_script not possible?
I got the following setup:
Parent & Child Theme (Parent contains basic stuff, but no loops, style, etc.)
inside the functions.php of the Parent Theme i call my init.file, that cares about ...
0
votes
2answers
52 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
2answers
94 views
Is the wp_enqueue method efficient?
I had a quick question regarding how you are supposed to load in scripts with Wordpress. I am developing a theme and I know that the best way to do this is to use the ...
0
votes
1answer
402 views
How do I implement the Wordpress Iris picker into my plugin on the front-end?
This question here is asking the same question as I am, but there were no adequate answers nor a selected correct answer so I am asking again hoping if I ask in a more coherent manner I might get a ...
0
votes
2answers
94 views
Including javascript for a shortcode
I'm creating a plugin that allows a user to use a shortcode. This shortcode depends on a bunch of javascript that needs to be present once the shortcode loads.
I'm having issues trying to decide when ...
0
votes
1answer
98 views
Problem getting .js file to load via a plugin
This http://jsfiddle.net/ambiguous/7L4WZ/ works...it removes empty <p></p> tags and then some but I can not git it to work from my plugin.
$('p').each(function() {
var $this = ...
0
votes
1answer
412 views
Deregister multiple scripts using a function?
I'm trying to deregsiter multiple scripts using the following function.
add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
function my_deregister_javascript() {
if ( ...
0
votes
3answers
1k views
wp_enqueue doesn't work
Some of you might know that I've been really struggling with trying to enqueue Javascript to my Wordpress theme and I just can't get it to work. I need to get this done somehow. I will keep this ...
0
votes
1answer
129 views
Enqueuing a script before anything else
I wondered if it was possible to change the order in which a script is enqueued.
I ask this because I wish to include the HTML5 enabling script but it needs to be included before any styles.
Is ...
0
votes
1answer
265 views
What's a good way to unenqueue all scripts for a single template page?
I've found that my attachment templates are inheriting the enqueued scripts for single posts. My first instinct was to unenqueue these scripts one-by-one or to do an is_attachment() check before ...
0
votes
1answer
29 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
1answer
42 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
1answer
225 views
chosen jquery library not loading - is not a function error
I am trying to load the chosen library: http://harvesthq.github.com/chosen/
I am enqueuing a .js file as below:
wp_register_script( 'js_custom', plugin_dir_url( __FILE__ ) . 'js/jquery.js', false );
...
0
votes
2answers
57 views
All of my Scripts and Enques are getting file not found
I have the following script and enque function, and the site properly renders it in the html head, however when I click the link to the css and javascript files the i get a url not found, however the ...
0
votes
2answers
75 views
If a Script has been enqueued but not registered can I still removed it?
There is a plugin that's conflicting with mine when the user loads the admin pages of my plugin, therefore I want to deregister and remove the conflicting script on these pages.
Here is the code for ...
0
votes
1answer
139 views
How to use wp_enqueue_script, style when required
There are lot of unused js & stylesheets in my theme.
here is wp_register function in my functions.php
wp_register_script( 'moder', base_url . 'js/modtom.js', array(), false, false );
...
