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

Load stylesheet on custom admin submenu page

I'm trying to load a stylesheet for a particular admin submenu page. The code below is what I came up with after looking up admin_enqueue_scripts in the codex: function my_function($hook) { if ( ...
1
vote
1answer
25 views

When can you get current page ID and initialize hooks right after?

I'm developing a plugin and need to know on what page user is and then add specific hooks and filters for that page. And my problem is that is_page() and the_ID() doesn't work outside of wp, ...
0
votes
0answers
28 views

Safari only bug: script enqueuing blocks other scripts

Looking for some advice. One page of my blog is an angular app that is loaded via systemjs. It loads fine in Chrome (and firefox) on my computers and Android phone. But Safari is very erratic and ...
0
votes
0answers
19 views

How to wp_enqueue_script with html?

I want to wp_enqueue_script multiple javascript with html and css. I place the html code in a page, but it's not working on my side. Only plain text is displayed. Here's the link: ...
0
votes
0answers
12 views

Which are the MediaElement.js scripts to enqueue

I'm loading (paging) posts with ajax, so I want to be able to render videos using MediaElement.js on newly appended content. I already have my script working but is failing if no video posts are ...
0
votes
0answers
11 views

How to list the scripts and styles enqueued for a certain page?

How do I get all the scripts and styles used on a certain WordPress page. I would like to see the following, Name of script/style URL to script/style Version of script/style And if a certain script ...
0
votes
1answer
21 views

Register script in one plugin, and enqueue it in another

I need to register a script in one plugin and enqueue it in another. This is not working the way I expect it would. Am I missing something? Plugin that registers script: add_action( ...
0
votes
1answer
67 views

Enqueueing a script and a style sheet not working

I am trying to enqueue both a child theme style sheet and a child theme script. I need to enqueue the script because I put CDN links in there for Bootstrap. I know my enqueue isn't working correctly ...
0
votes
0answers
20 views

Enqueing Scripts

Perhaps more of a verification question for me... My plugin uses a few JS files which it enqueue's, however I am finding that in some instances of WordPress and some Themes the JS is not working as ...
0
votes
0answers
25 views

After wordpress widget save (ajax call) tinymce editor gone, data not saved

I have made tinymce editor for textarea fields in widgets. I'm enquing scripts: wp_enqueue_script('tinymce', home_url() . '/wp-includes/js/tinymce/tinymce.min.js'); wp_enqueue_script('tiny', ...
0
votes
1answer
26 views

Enqueue specific script on account creation (and never again)

I'd like to submit a Google Analytics event when a user creates an account. Right now I'm checking for the presence of a 'first_login' user meta value on every page load. If it doesn't exist, the ...
1
vote
1answer
71 views

Javascript not working?

2 days ago my javascript was located in my footer folder running correctly, until suddenly it stopped working. I was lazy to do the proper way of enqueueing, so I officially did that to see if it ...
0
votes
2answers
79 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
24 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
41 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
29 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
212 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 ...
0
votes
0answers
18 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
1answer
28 views

WooCommerce not enqueuing its scripts [closed]

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
21 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
26 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
24 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
47 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
36 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
24 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
19 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
27 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
106 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
22 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
2answers
44 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
21 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
32 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
53 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
61 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
44 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
37 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
43 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
24 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
39 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
82 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
37 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
21 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
119 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
67 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
76 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
86 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
79 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
88 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 ...