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
18 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
13 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
23 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
30 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
13 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
26 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
16 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
19 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
31 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
36 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
22 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
25 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
26 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
15 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
34 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
36 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
24 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
54 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
46 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
39 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
53 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
51 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
45 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
66 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
37 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
69 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
79 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
380 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
91 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
18 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 ...
0
votes
1answer
39 views

Custom Plugin - CSS works, JS doesn't

In the plugin I'm making, I use separate js and css files (____.js, ____.css). This is the first time that I've included an external .js file in anything. I'm registering and enqueueing both in the ...
0
votes
1answer
207 views

Prevent Version URL Parameter (?ver=X.X.X) on Enqueued Styles & Scripts

Use Case I've been experimenting with Chrome's Dev Tools Workspace features. It includes the ability to edit a file directly in Dev Tools and have the saved stylesheet refresh itself (or even compile ...
0
votes
1answer
29 views

Remove / overwrite some functions in buddypress.js

What's the best practice to overwrite some JS-functions in buddypress.js? There are some quite annoying things in there like animating the form-fields on click/blur/post which I need to remove ...
0
votes
0answers
56 views

wp_enqueue_media problem

I am trying to build up a form where user can request some post information including feature image. For uploading the image i have used wp_enqueue_media() which works nicely in all free themes ...
0
votes
2answers
39 views

wp_enqueue_script only works outside of action

So i've been trying to figure this out for awhile now. The following code does not seem to work for me. The javascript file will not be included in the footer ( or anywhere for that matter ) function ...
0
votes
0answers
60 views

Enqueue javascript that inserts custom php widget into jQuery-constructed div

What I need done: The mobile menu on the site (let me know if you want to see the dev site, so I don't get marked as spam for posting the link) is loaded by a script that hides the main menu when the ...
0
votes
0answers
34 views

How to figure out which plugin or theme is adding google analytics

Google-Analytics.js is being called on the website, but I can't figure out what is calling it. This is all the shows in the Dev Tools: <script async="" ...
0
votes
0answers
15 views

simple custom lightbox failing

I've built a simple lightbox, easy enough with organic pages, I have the code working on codepen and a local file, however the second I throw it in wordpress it isn't working, maybe you guys can help ...
0
votes
1answer
105 views

Enqueue script on specific WooCommerce template

I would like to enqueue a lightbox script on the WooCommerce page content-single-product.php. I have tried the following via functions.php: if(is_page_template( 'page-gallery.php' ) || ...
0
votes
0answers
44 views

Enqueue a <script> block into <head>

I'm building a plugin that uses a shortcode to display a map and list of locations. Part of displaying that list of locations requires a handlebars.js template. That template exists as a script block ...
0
votes
1answer
75 views

Notice: wp_enqueue_script was called incorrectly

This is an error I'm receiving when my plugin is activated: Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, ...
0
votes
2answers
57 views

Why does javascript works only if logged in?

I'm trying to implement a simple script: jQuery(document).ready(function($){ $(window).scroll(function(){ if($(window).scrollTop() >= $('#masthead').outerHeight()) { ...
1
vote
0answers
24 views

get_template_directory_uri not dependent on WP_HOME in wp-config.php?

For testing on mobile devices in my local network, I've set up xip.io according to this blogpost I can access the site, but even though I added the following to my wp-config.php define('WP_HOME', ...
0
votes
1answer
38 views

Why does deregistering jQuery cause other scripts not to load?

I've inherited a site using the following in functions.php: if ( ! function_exists( 'foundation_assets' ) ) : function foundation_assets() { if (!is_admin()) { ...
0
votes
0answers
35 views

Initializing scripts in wordpress

I'm trying to initialize a script in wordpress. So far I've added the following to my theme: function theme_name_scripts() { wp_enqueue_script( 'stellar.js', ...
1
vote
1answer
26 views

Declaring script dependencies between scripts enqueued with different action hooks

Consider this scenario: I enqueued some scripts in my custom theme. Then I set off to building a plugin that I want to be used only with that one theme. I want to enqueue other scripts in my plugin ...