The wp-enqueue-script tag has no wiki summary.
0
votes
1answer
67 views
How to enque js script in footer that are not in .js file?
I do have code that is js script inline together with php script is their possible way to enque it to footer without puting it on .js file
To clear explanition on my question here is my example code
...
0
votes
3answers
759 views
Loading Modernizr (or other JavaScript libraries) for use in a plugin
Download a copy of Modernizr, put it in your plugin’s directory and simply enqueue the script whenever needed. Done.
The problem is that Modernizr may already be loaded by another plugin. You ...
0
votes
2answers
88 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 ...
0
votes
1answer
179 views
Adding Pinterest Script Before Closing Body Tag
According to the Pinterest website in order to add the Pinterest button to any page I have to add the following just below the closing body tag:
<script type="text/javascript" ...
0
votes
2answers
99 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 here: http://tinyurl.com/c2fwy9f
This budget calculation tool is of course tied to a php script that executes the fields in ...
0
votes
1answer
229 views
admin_enqueue_scripts not rending JS file correctly
I'll keep this short and sweet, I want to load a JS file in the admin panel as part of my plugin, and through tons of research I have a few different options that have all ended with the same problem ...
0
votes
2answers
803 views
Best Way to Include Scripts on a Specific Template Page
This is something that has always confused me and I could use some help.
I want to do four things directly above the closing body tag:
include jQuery (WordPress version is fine)
include a jQuery ...
0
votes
1answer
295 views
unable to wp_enqueue_script('suggest');
i'm not able to enqueue the built in autosuggest script in my wordpress theme.
wp_enqueue_script('suggest');
my current workaround for that problem is to deregister, register manually an then ...
0
votes
1answer
93 views
Loading scripts on a single page plants the script in the footer
I'm using this code to plant a script on a spesific page, it works but inserts the script into the bottom of the page not the top - I'm at a loss to explain why! Is there a way to do this that results ...
0
votes
2answers
133 views
Hook for writing text string after footer scripts
I'm looking to insert a string of JavaScript variables AFTER the in_footer enqueued scripts. When I write the string via the wp_footer hook, they occur before the in_footer scripts. Is there another ...
0
votes
1answer
192 views
wp_enqueue and Dependencies
Easy Question: If I enqueue a script as follows:
Version A:
wp_enqueue_script('my-script', plugins_url( '/path/to/file', __FILE__ ), array('jquery', 'jquery-ui-core'));
Do I need to enqueue jquery ...
0
votes
1answer
961 views
TinyMCE in a div / textarea on frontend?
I have a post on my frontpage and I want to add the TinyMCE editor to it and could not make it work.
I've tried these guides without any luck
...
0
votes
1answer
66 views
should i be checking for jquery before enqueing it in a plugin
At the start of a typical plugin which uses jquery I have something like the following
wp_deregister_script('jquery');
wp_register_script('jquery', ...
0
votes
1answer
104 views
custom fields cannt be seen with version 3.1
I had a Theme that worked OK with ver 2.7. Now that I upgraded to 3.1; I cannot see the "custom fields" in the posts(may be hidden??). Can someone help.Thanks
0
votes
2answers
551 views
Loading a newer version of jQuery within WordPress
I've read about the WP enqueue_script() function, but if I wanted to use a newer version of jQuery than what my WP installation is using, can I load it through this & WP will use the latest ...
0
votes
1answer
394 views
Run a jquery script on on a certain template page
All I want to do is basically this:
wp_register_script( 'jquery_zebra', get_bloginfo('stylesheet_directory') . '/library/scripts/jquery.zebra.js', array('jquery'));
wp_register_style( ...
0
votes
1answer
392 views
Is there a filter for enqueue script to strip the type=“text/javascript” property
script type="text/javascript" is optional in HTML5 and all browsers (even old ones) recognise JavaScript without it. I am building an HTML5 site and want my script output to be consistent. However, ...
0
votes
1answer
38 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 ...
0
votes
1answer
39 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
1answer
34 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
29 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
75 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
1answer
48 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
2answers
62 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
220 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
217 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
1answer
44 views
Why is this function crashing my wordpress installation? [closed]
I'm new to wordpress and programming in general. For my first site there is a custom template in which I want to load a javascript library. After registering and enqueueing it in functions.php my site ...
0
votes
1answer
49 views
Enqueue ONLY Plugin Styles and Scripts
Is there a way to enqueue only plugin styles and scripts without wp_head? I have a plugin I'm working on which overrides the page template, but I still want to include all other plugins without ...
0
votes
1answer
94 views
Register script/style: Is it possible to customize the version query string via plugin?
Expanding on the question in the title:
I would like to find a way (via a plugin) to use timestamps for the JS and CSS file version query strings that are output with wp_register_style and ...
0
votes
1answer
68 views
“admin_enqueue_scripts” hook or $_GET['page']?
When adding a function to "admin_enqueue_scripts" a hook is passed to the function. It looks like this "toplevel_page_nameofyourpage". That works great, but how is it different from checking the $_GET ...
0
votes
1answer
61 views
How do I pass $in_foooter to wp_enqueue_script() without passing other params?
I have some scripts that I'm enqueueing like this:
wp_enqueue_script("jquery");
wp_enqueue_script("myscript" , get_template_directory_uri()."/js/myscript.js", Array('myscript'), " ");
I want to ...
0
votes
1answer
201 views
wp_localize_script & wp_enqueue_script not working in front end
Here is my code snippet :
wp_enqueue_script( 'ajax-script', get_stylesheet_directory_uri().'/js/myajax.js', array('jquery'), 1.0 );
wp_localize_script( 'ajax-script', 'ajax_object', array( 'ajaxurl' ...
0
votes
1answer
71 views
Why is it wrong to use admin_print_scripts-{hook} to enqueue a script (.js) file?
According to the Codex, it should only be used for inline script tag(s) in the head. I've been using add_action('admin_print_scripts-{my-hook}' for injecting .js and ...
0
votes
1answer
72 views
colorbox not loading in <head>
I can not get colorbox fully loaded.
I am trying to add color box to use in my plugin admin.
I do not need it for the front end.
I can get the css but can not get jquery.colorbox-min.js or the ...
0
votes
1answer
135 views
Fatal error: allowed memory size when after using enqueue_script
I an trying to enqueue four script files and keep getting this error: Fatal error: Allowed memory size of 103809024 bytes exhausted ... wp-includes/class.wp-dependencies.php on line 175.
I used ...
0
votes
1answer
398 views
Custom Admin CSS styles to style media uploader?
Hopefully a simple answer to this. Using the wp custom header feature, the media upload screen shows an extra field: "set as header". I'm trying to make this text bigger as it can easily be missed.
...
0
votes
1answer
331 views
wordpress enqueue script not working
I am using a carousel to display latest jposts on my front page and I am using the following code but it's not working.
function my_load_caroufredsel() {
// Enqueue carouFredSel, note that we ...
0
votes
1answer
201 views
How To Include JavaScript Files Only In Single Posts?
I know that wp_enqueue_script() inserts Javascript files into the WordPress header in the appropriate place.
However, I want to include my Javascript in all single posts, ignoring the WordPress home ...
0
votes
1answer
281 views
wp_enqueue_script won't load in header?
Read up on this, and I believe I'm doing everything right. Everything is getting loaded in the footer. Here is my code:
function load_kenburns() {
if ( !is_admin() ) {
wp_register_script( 'kenburns', ...
0
votes
1answer
349 views
How to Add a Custom Script to Customize.php
I am having a rather difficult time adding a script to the 3.4 Theme Customizer (i.e., customize.php). If I want, I can deregister jquery and add it from googleapi as follows:
wp_deregister_script( ...
0
votes
2answers
481 views
Setting Variable Path to Template Directory inside Script
I have HTML5 Template with 5 pages. I am converting it to a WordPress Theme.
I have a contact page. This page includes 'forms.js' script to send contact form data to 'MailHandler.php' file.
Inside ...
0
votes
1answer
52 views
Why do I have to specify all parameters for wp_enqueue_script to load my jquery in the footer? [closed]
wp_enqueue_script('jquery', includes_url() . 'js/jquery.js', array(''), '1.7.2', true); // loads in the footer
wp_enqueue_script('jquery','', array(''), '', true); // loads in the head
I just think ...
0
votes
2answers
944 views
WP_enqueue_script() loads them always in wp_footer()?
This is my example code placed in functions.php:
function my_init_method() {
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-core', false, array('jquery'), false, false);
...
0
votes
1answer
299 views
if custom posts type exists and there are posts load script
I have registered a custom post type 'featured_post'. I am looking for a way to test if the blog home page has any 'featured_post' posts on it and if it has load a javascript file.
The ...
0
votes
1answer
285 views
wp_enqueue_scripts in a plugin's class
I'm trying to enqueue jQuery UI in a plugin under a class method. I have this so far:
class AV_Slider {
function slider_load_js(){
wp_register_script('jquery-ui-core', ...
0
votes
1answer
165 views
Enqueueing Scripts/Styles mid-page
Since WP 3.3, the codex has been updated for both wp_enqueue_script and wp_enqueue_style that you can now enqueue both mid-page (within the HTML body).
I see this as an advantage because:
It's ...
0
votes
1answer
53 views
Wordpress Plugin Authoring question about jquery and css
When I'm writing a plugin, do I assume that jquery is included, or should I always wp_enqueue_script it and let wordpress figure it out?
Also, what's the best practice for getting an image path ...
0
votes
1answer
144 views
wp_enqueue_script does not recognize my js file?
my wp_enqueue_script does not seem to work, i can't understand why :
i have a child theme of twenty ten,
i wrote this in my functions.php file (in my theme) :
<?php
function my_scripts_method() ...
0
votes
1answer
116 views
Page not found when trying to link to files in child theme directory
I'm trying to create a child theme based on Toolbox 1.4 by Automattic.
I have my scripts file saved as child_theme/js/scripts.js on my server and I enqueue it by using
wp_enqueue_script( 'scripts', ...
0
votes
1answer
120 views
Loading Images from Javascript on the Front End
I'm getting some 404 errors on image paths in this plugin I'm building.
I'm trying to build a plugin that has some Javascript and images (like a close icon and a progress bar) that I want to load on ...
