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

1
vote
2answers
19 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
13 views

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

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

How to load css in the footer

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
34 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
41 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
28 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
70 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
14 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
30 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
31 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
23 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
7 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
38 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
25 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
37 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
41 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
18 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
32 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
22 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
18 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
43 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
175 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
423 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
55 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
60 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
24 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
31 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
132 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
372 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
456 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
36 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
42 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
15 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
163 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, ...
0
votes
3answers
112 views

Enqueue core jQuery in the footer?

I have this in my functions.php file and I can't get jQuery to load in the footer. The includes file loads in the footer fine, though. What else do I need to do? function starter_scripts() { ...
0
votes
2answers
288 views

How do I get jQuery to Load before Bootstrap?

I am building a Bootstrap / WordPress site and I am having an issue with bootstrap.min.js loading before jquery, which results in issues like the navigation not working correctly. Here is how I have ...
0
votes
4answers
116 views

Add js into a theme [closed]

I am trying to create new WordPress theme from scratch. I have working html, css and js files. To add JS into wordpress theme I used: function my_scripts_styles() { wp_enqueue_script( 'easing', ...
0
votes
1answer
180 views

wp_enqueue_script() not working at all

I'm trying to enqueue JavaScript files using wp_enqueue_script(), but it isn't working at all. Here is my code: function load_css_js() { wp_enqueue_style('gdgt-base', get_template_directory_uri() ...
1
vote
1answer
54 views

How to enqueu php files with custom variable & conditionals?

Hi I have taken over a website with half-customized theme. It was an outdated theme with bunch of scripts and formatting. Currently I encountered a small issue when enqueue stylesheets in ...
0
votes
0answers
19 views

How can I properly enqueue tags <link> in WordPress to use with Web Components?

The Chrome browser supports Web Components and I would like to add a number of them in WordpPress pages, but using the queuing mechanism as in the case of the functions wp_enqueue_script and ...
0
votes
1answer
63 views

Bootstrap sticky menu in WordPress

I have a menu which I have assigned the affix class using the JS and the data-spy methods but it doesn't work, there are no JS errors in my console (firefox or chrome) and the js and css of BS are at ...
0
votes
1answer
59 views

Understanding wp_enqueue_style

I am trying to understand how wordpress works, but I am having issue understanding how wp_enqueue_style(), wp_enqueue_script() works in relation to page output. From my understanding, these functions ...