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
1answer
18 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
24 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
0answers
39 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
19 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
20 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
28 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 ...
-3
votes
0answers
23 views

Updated: Encountered two errors

I'm creating my own theme. The problem is I'm getting these error: Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the ...
0
votes
1answer
22 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
32 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
46 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
108 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
53 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
11 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
17 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
32 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
119 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
20 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
40 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
33 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
32 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
33 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
11 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
53 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
27 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
43 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
44 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
21 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
35 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
23 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
19 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 ...
0
votes
1answer
25 views

Enqueuing scripts and styles in custom plugins

I have a couple of questions regarding enqueuing scripts and styles in custom plugin code. I've recently come across plugin code where scripts were enqueued hooing into the template_redirect action ...
0
votes
0answers
50 views

Make jQuery library load before plugin files in child theme

I'm setting up a site with child theme. I have installed several plugins. But few plugin files (fancybox, jQuery UI files) are loading before the jQuery library. So I am getting this error: undefined ...
0
votes
1answer
299 views

How to create a child theme with multiple css files.

Noob at wordpress development. Trying to create a child theme for a client. But the problem is that there are many css files and not one as per many tut's available, in my senario there are multiple ...
0
votes
1answer
626 views

Move all the JS files to the bottom|footer, the right way

In order to speedup my site load and prevent scripts from render the page I'm trying to move all the possible scripts (meaning JS files) from head to footer. After read and do some research I made ...
0
votes
2answers
59 views

debugging js scripts

I am having problems enqueuing javascript. When I use the script tag in the head section of my site, everything works just fine. If I take the scripts out and use enqueue, the site breaks but I don't ...
-1
votes
1answer
64 views

Enqueue scripts in the footer

I'm trying to modify a plugin for enqueue scripts in the footer, because my jQuery link is in the footer. The plugin: add_action('wp_enqueue_scripts', 'fjgwpp_addCSSandJS'); function ...
0
votes
0answers
25 views

WordPress manually load TinyMCE scripts

How can I manually load the scripts that TinyMCE requires to run on the front end of the site? I'm pulling wp_editor through AJAX, so I know I'll need to run actions in order to get the proper scripts ...
0
votes
0answers
38 views

Enqueue script in ajax shortcode call

I load a template part via ajax which contains a shortcode, which needs a javascript file to draw something. How do you enqueue it? Should I echo <script></script>? But what if it's ...
0
votes
1answer
149 views

Theme now uses require.js and enqueue script no longer works

I created a small custom script that fixes a sidebar at different point depending on if there is a banner. I used enqueue script in my child functions file and then a custom.js file with my ...
0
votes
0answers
25 views

enqueue scripts, add_action not running at all

Here is my code. I only got the '000' and the '444' echo. This is a template php file under one of my theme folder.
1
vote
0answers
20 views

How to enqueue admin content outside admincp

How do I enqueue admin javascript/css/header outside admincp, and specifically outside Wordpress. I checked one of the admin pages, and it contains this line: require_once( ABSPATH . ...
0
votes
1answer
455 views

Proper enqueue for child theme functions.php

I didn't set up a child theme to start off with, so now I'm trying to do that. I do have the child theme active. I read over this POST and still cannot get my child theme style.css to hook before ...
1
vote
2answers
592 views

tinymce is not defined when not using wp_editor

I am using jQuery tinyMCE to populate dynamically generated text areas with tiny MCE editors. When I use the WordPress wp_editor function before I call the jQuery version, I have no issues. If I do ...
0
votes
1answer
37 views

Enqueueing TinyMCE

I have decided to pull duplicated javascript from multiple custom post type files into one 'admin.min.js' file for use in all admin pages. So far I have got the script to load. This is in my ...
0
votes
0answers
27 views

custom script not loading at admin pages

I want to load a custom script on the admin pages. Seems simple right. Still, for some reason the script is not loading. I've tried putting this in my themes functions: add_action( ...
0
votes
1answer
45 views

How to include a JS file in this theme?

This makes the Jquery script work in a plugin: wp_enqueue_script('metabox_js', plugins_url('add_meta_box/js/metabox.js',dirname(__FILE__) ), array('jquery')); I have been trying for ages, & this ...
0
votes
0answers
16 views

Most optimal way of starting fresh, without using other theme or dropping old files?

I have an unusual situation: A website with very trashed styles.css (thousands of lines of trashy code), around 70+ custom templates, tons of js libraries loaded. First reaction was, lets start fresh ...
0
votes
1answer
185 views

wp_enqueue_script was called incorrectly… i want to work with debug on

i know that this error is just a notice: notice: wp_enqueue_script was called incorrectly. scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, ...