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
40 views

Most elegant way to enqueue scripts in function.php with foreach loop

I wonder is there a way of running wp_register_script and enqueue with the help of foreach loop to manage label and dir? For example, function wbs_app_components(){ $scripts_list=array( ...
0
votes
1answer
16 views

How to load script conditionally on custom field in wp_postmeta?

I'm trying to tidy up some of the code that has been doing its job for quite a while. Specifically, I used to load scripts in header.php and I'm trying to move that into functions.php. One of the ...
0
votes
0answers
18 views

Why would javascript files be included in header on one site, but not others?

Why might some javascript files be included in the head section on one site, but in the footer of hundreds of other similar sites? I have several different multisite Wordpress installations on my ...
0
votes
2answers
30 views

Use wp_enqueue_scripts from included php file

I've got a realy hair pulling problem here. I've started cleaning up a plugin i've made and sort some of the functions in diffrent files. but i've got a problem with wp_enqueue_scripts. when i ...
0
votes
1answer
25 views

Do I need to register my own created .js and .css files

I have several .js and .css files which I created for my theme. (not a child theme) Styles and scripts are at the moment hard-coded in the head and work as wished. Now I read a lot about register and ...
4
votes
1answer
149 views

Move Wordpress native javascript to bottom of page?

Checking my page in google page speed insights, it complains that there are some javascript that is blocking the rest of the page from loading. The javascript in question is native Wordpress scripts ...
-1
votes
0answers
14 views

'Custom Twitter Wordpress' plugin causes wp_enqueue_script errors?

The debug log is: Notice: wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or ...
0
votes
0answers
14 views

jQuery.suggest only suggestion is “0”

I'm trying to get suggestions in a text field with data from a database, inside an admin page. The only suggestion I get, no matter what, is always "0".. why? Relevant code parts the ...
-1
votes
0answers
22 views

Creating a blank wp_head() action

I'm creating a plugin and one of the screens of the plugin needs to be a completely fresh template page. I've got it all hooked up and it's working fine but the issue is that there are certain plugins ...
-1
votes
1answer
21 views

WooCommerce not enqueuing its scripts

I am trying to create a new theme in WordPress powered by WooCommerce. The problem is that WooCommerce for some reason doesn't enqueue its scripts, so the "Add to cart" Ajax feature and sorting drop ...
0
votes
1answer
17 views

Including Styles and JS files to work ON my plugin interface

Hey WordPress community, I've been having a couple of issues with trying to add a stylesheet and a JavaScript file which run on my plugin interface. So far i have this: ...
0
votes
0answers
23 views

Conflicts with jQuery

I wrote a plugin that works fine, but in one site I get jQuery loaded twice even if I don't enqueue it myself (I guess the theme loads it also). I tried to deregister it and than again enqueue but ...
0
votes
1answer
17 views

early enqueueing javascript file in page template, not in functions.php

Is it at all possible to enqueue javascript file early on page template file? I want to use this way of including scripts to keep my structure clean (so each page template has its own styling and ...
2
votes
1answer
42 views

Is it safe to enqueue a font style without putting http or https?

I have seen a few WordPress sites and tutorials enqueuing fonts like this. Does this work with http and https sites? Is it safe to do this? I see these exact URL's in the source code when testing ...
1
vote
1answer
25 views

How to switch css files according to devices and button click?

I am trying to enqueue a responsive css file if the website is opened on mobile devices. Also I want to switch / enqueue a default or non-responsive css file when a button is clicked. The ...
0
votes
1answer
27 views

wp_enqueue_scripts and CSS

I know wp_enqueue_script has the ability to have a dependency which is great. Now what if I can't give it one? What if all I want is for it to be the last script in the list of generated CSS ...
0
votes
2answers
22 views

dequeue not work

i use a plugin that containing this code and i want to change js location to be located in my template directory instead of plugin without editing the plugin files class jqueryTimelinrLoad { ...
0
votes
0answers
16 views

Wordpress listening on specific port

I am trying to get Wordpress to run on vagrant I have port forwarding for 127.0.0.1:8080 on my host machine. Everything runs just great except plugin scripts are stripping out :8080 from their url ...
0
votes
1answer
26 views

How to disable jQuery tabs when customizing the theme

Regarding this yet unsolved bug, how can I disable jQuery Tabs from the frontend when using the theme customizer?
0
votes
1answer
52 views

Jquery function working in Dev Console but not otherwise [duplicate]

Can someone help me utilize native wordpress jquery to run my function? The only working test i have done is to load an external jquery resouce via the chrome dev console and then add my function to ...
0
votes
1answer
17 views

wp_enqueue_script adds only the first script

function banana_scripts() { wp_enqueue_script('grid', get_stylesheet_directory_uri() . '/js/jquery.min.js', null, null); wp_enqueue_script('grid', get_stylesheet_directory_uri() . ...
0
votes
1answer
36 views

Localizing script to pass a value to a javascript function

i'm really getting crazy about this. after hours of trials, i can't get out of this. I'm trying to pass a php variable value to an enqueued jquery script but i can't. here is my code. php : ...
0
votes
1answer
19 views

Dequeue set-post-thumbnail.min.js

Want to alter the behavior how set-post-thumbnail works (add additional functionality upon successful set post thumbnail). Looking on how to dequeue the stock set-post-thumbnail.min.js script so I can ...
0
votes
1answer
28 views

Enqueueing Scripts and Styles to page template that has html

I built a custom calculator using html5, css3, and jQuery. I have it live and it works well but now someone would like to put my calc on their WP website and we can not figure out how to get it on his ...
2
votes
1answer
46 views

$wp_styles->registered not giving ALL the styles?

I'm pretty new to Wordpress programming (been using it for a while, but never got into the nitty gritty). So, I'm trying to "minify" some JS/CSS files into common ones. I'm manually joining the files ...
0
votes
2answers
47 views

Plugin Loading Scripts and Styles on Every Page - Even when not being used

I have a plugin that is using Class style programming. I'm completely stumped - scripts are being loaded on every single page, even if the plugin is not being used on that page. Since the plugin ...
0
votes
1answer
32 views

Plugin Development - Class Constructor Not Firing wp_enqueue_style action hook

Writing my first Wordpress plugin that uses a Class approach. It is being called on a page via a shortcode. In testing, the shortcode is working and the shortcode specific php file is being loaded. ...
0
votes
2answers
36 views

Deregister scripts from plugin

I have an own class that deregisters all scripts and styles and creates 2 cached files one for scripts and one for styles that is registered in the end. This runs inside theme, my problem is that I ...
1
vote
1answer
35 views

How to set cookies to switch style sheets when a link is clicked and set it till another particular link is clicked?

I have a very old site. Now I want to make it responsive without changing the theme an it's style sheet. Requirements: Can not change the theme. Can not create child theme. By default, the site ...
0
votes
0answers
19 views

Metabox on a custom page - How to include the appropriate default scripts and styles?

I have created a metabox on a CPT's submenu page created using add_meta_box. I see the metabox's style is not similar to the other metaboxes available on post edit pages. Moreover, the accordion type ...
0
votes
2answers
36 views

Should we explicitely enqueue jQuery and our theme's main stylesheet?

I noticed that if I don't explicitely enqueue my theme's main stylesheet and jQuery in my functions.php, these are loaded anyway. But perhaps it's better for some reason to enqueue them ? What is the ...
0
votes
1answer
58 views

How to properly dequeue scripts and styles in child theme?

I made a parent theme and a child theme in one of my project. I enqueued CSS and JavaScripts in my parent theme like below: function project_necessary_scripts() { //Stylesheets ...
0
votes
1answer
29 views

video.js not enqueueing?

I'd really appreciate any light you folks could shed on this issue. I was tipped off by Firebug that the function 'videojs' is not defined, when it tried to run the block of script which links to the ...
0
votes
2answers
18 views

scripts not loading

this is the header section for enqueueing my scripts <?php wp_enqueue_script( 'menu' ); wp_enqueue_script('thumbnail'); ?> <?php wp_head(); ?> <link rel="stylesheet" href="<?php ...
0
votes
1answer
89 views

How to include jquery validate in a template

I am attempting to load jquery's validate methods in my template file. The idea is to be able to run something like this: $jquery("#generateForm").validate({ submitHandler: function(form) { ...
3
votes
1answer
59 views

Wp_head and wp_footer vs wp_enqueue_script javascript files?

I'm converting a bootstrap html website into Wordpress. Now, all recommend using wp_enqueue_script() for registering javascript files. i.e. function themeslug_enqueue_script() { ...
0
votes
2answers
57 views

custom post with loading script per single post

I read many Q&As here on SO...(and elsewhere but they don't count...lol) I think I follow the rules of WP.org but still it does not load the scripts. Scenario: Custom template for post in Php: ...
0
votes
1answer
73 views

Use wp_enqueue_scripts, not wp_print_styles?

Everywhere is said that you need to use wp_enqueue_scripts() instead of wp_print_styles(). wp_print_styles() is located in wp-includes/functions.wp-styles.php. So what does it mean? What should I ...
0
votes
1answer
63 views

wp_enqueue_style referencing parent theme

I have properly set up a child theme and am adding stylesheets and scripts in my new functions.php file. The only problem is, my newly enqueued stylesheets are being referenced using the parent theme ...
0
votes
1answer
67 views

FullCalendar in WordPress is not working

I'm trying to implement FullCalendar on my WordPress website in order to display the Hebrew calendar from the Hebcal API. I believe I have loaded all the requisite scripts and styles via use of the ...
0
votes
1answer
90 views

How to add JS snippet before closing <head> tag?

I'm setting up jQuery UI on one of my WordPress pages that uses a custom template (course-landing-page.php). I enqueued the scripts for jQuery UI the proper way, but I need to add a JavaScript snippet ...
0
votes
1answer
47 views

Can't seem to get JQuery working (wordpress plugin)

Im trying to learn how to create plugins using Wordpress but I stumbled upon this problem: Whenever I'm trying to run JQuery I get undefined error's and such... I tried different things I found ...
1
vote
2answers
98 views

Problem in loading javascript in footer

I have written a small plugin where i have loaded following scripts wp_enqueue_script('jquery', plugins_url('/js/jquery.min.js', __FILE__),'','1.7',true); wp_enqueue_script('new-cycle', ...
0
votes
0answers
16 views

How can I to add css or js to wp_head from shortcodes or widgets? [duplicate]

How can I to add css or js to wp_head generated from shortcodes or widgets?
1
vote
1answer
124 views

How to load css in the footer [duplicate]

I was trying to move the load of my style.css in the footer of my wordpress theme. I have already done something similar with 2 js files and it works fine, they load in the footer: function my_init() ...
0
votes
1answer
1k views

Simple Button onClick to trigger jQuery function

I have looked similiar questions but any of it didn't worked I want to trigger jQuery function with onClick button, but it didnt worked. HTML structure : <button class="my-button" ...
0
votes
3answers
149 views

Include Jquery libraries in wordpress theme?

I have a file in my theme's JS folder named cycle2.js. How do I include the Jquery from 'wordpress→includes' into my theme? How do I load this custom JavaScript file 'cycle2.js' into my theme? I ...
0
votes
0answers
12 views

Is it possible to use login_enqueue_scripts to add the stylesheet to head section? [duplicate]

here where I'm having trouble: I need to add my styleshhet to the WordPress login page among the tags <head></head> but my code doesn't work, it always enqueue the stylesheet before ...
0
votes
1answer
19 views

Where to place add_action when enqueueing?

Do I place add_action before or after function myTheme_script {enqueue functions here} when enqueueing a script or stylesheet into functions.php, or does it matter? I'm seeing both from moderators on ...
0
votes
0answers
18 views

Mootools, Wordpress, Print Nuke problems

I am wanting to implement a code for eliminating unwanted DIV's during printing that I found here: http://davidwalsh.name/css-print-javascript-double-click I got this working correctly in a regular ...