The wp-enqueue-script tag has no wiki summary.
0
votes
1answer
27 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
21 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
63 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
28 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
21 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
39 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
52 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 ...
-1
votes
0answers
25 views
Enqueue script site-wide - but exclude from a specific category
function my_custom_script() { if ( !is_admin() )
{
wp_register_script('autoplay', ('the-script-goes-here'), false);
wp_enqueue_script('autoplay');
}
} add_action( 'wp_print_scripts', ...
0
votes
0answers
23 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
31 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
35 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
36 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
30 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
43 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
8 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
...