The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
3answers
37 views

How do I enqueue a JavaScript in my footer via the functions.php file?

Okay, so I'm well familiar with the way to properly enqueue a stylesheet or JavaScript in the WordPress header via the functions.php file. Recently though I came across a situation that has me ...
0
votes
0answers
41 views

How do I display the handle for all front-end enqueued scripts in plugin options page?

I use the following function in my plugin to display all the scripts handles in my plugin options page but it display only the handles of admin scripts: function my_detected_scripts() { global ...
2
votes
2answers
58 views

Correct Method to run scripts with dependencies without enqueue?

With enqueue you would change $deps to your script or array of scripts that are needed to run first for your script to work. <?php wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); ...
0
votes
0answers
23 views

How to exclude scripts from being moved to the footer using their handle?

I'm working on a small plugin that moves all scripts to the footer using the following code: function move_scripts_to_footer() { global $td_options; if ( !is_admin() and isset( ...
3
votes
1answer
66 views

Get list of scripts / styles and show file which enqueued them

I want to show what scripts and styles have loaded on a page and which plugin / theme / file has added them to the page. We can show all scripts and styles using: <?php global ...
2
votes
2answers
169 views

WordPress Script Loading/Unloading — wp_deregister_script('jquery')

I have a few questions relating to WordPress loading / unloading up javascript tools. After reading a nicely written response to a question by Pieter Goosen, that got me to do a bit of studying and a ...
2
votes
1answer
266 views

How to get a jQuery script to run on a page?

I am having a hard time figuring out how to get a jQuery script to run on a Wordpress page of mine the "correct" way. I have followed this article and implemented what the first answer says to do. ...
1
vote
1answer
57 views

How to load library scripts in admin from plugins in noConflict wrapper?

For my plugin I need to make a meta box for some custom fields in my CPT (xyz), and to organize the fields, I need to implement tabs. And I's taught to load jQuery/JavaScripts using ...
0
votes
2answers
116 views

WP_ENQUEUE not working with Foundation 5 (resolved)

EDIT: PLEASE SEE MY ANSWER BELOW FOR ASSISTANCE :) feel free to use the code! I've recently started integrating Foundation 5.2.3 into Wordpress 3.9, and I am having issues with getting jquery to ...
0
votes
2answers
39 views

Register scripts located in child theme?

I'm having a lot of trouble registering scripts located in a child theme folder: This works fine: function register_scripts() { wp_register_script( 'newsletter', get_template_directory_uri() . ...
1
vote
1answer
15 views

Correct check for any admin page with editor

I have read the codex, but found it a bit incomplete. I like to load stuff only on pages where the post editor is visible. This should include custom post types and everything. I am a bit insure ...
0
votes
1answer
32 views

Make different sites on multisite reference same script

I'm using multisite and want all my scripts to point to the same URL so they are optimized as well as they can be. Currently I have: http://www.site.com/news/wp-content/themes/js/bxslider.js ...
0
votes
2answers
19 views

is there a way to get all queued scripts/styles into a template without `get_header()`?

in my main plugin page i check if a certain page is visited if so, i load a certain template. in the following way: add_filter( 'template_include', array($this, 'includeTemplate'), 99 ); public ...
15
votes
7answers
586 views

What is your best practice to execute one-time scripts?

The Problem We all have been in a situation like this, and a lot of questions on this site need a solution like this. You either have to update a database, insert a lot of data automatically, convert ...
2
votes
2answers
91 views

Setting up an API “listening” page

I need to create a PHP script that will receive data from another application via an HTTP post, process that data, and update the WordPress database. This script will run silently (i.e., no HTTP ...
0
votes
1answer
42 views

Auto create description in post

I want to create a script for when I add a title and an image to a post, and then when i publish, i want it to auto create a description Something like . . . . . You are viewing [title of post]! ...
0
votes
0answers
64 views

how to remove scripts loaded in the footer

Is it possible to remove scripts that are loaded in the footer in wordpress? I currently have the code that works for scripts but only for the one's that are added in the header via wp_enqueue_script. ...
0
votes
1answer
78 views

Ajax navigation and scripts loaded only on certain pages

I'm building a theme. The theme post navigation is done through jQuery Ajax. I've been several plugins to see compatibility and I have a problem with the Ajax functionallity. Some plugins such as ...
0
votes
1answer
794 views

Script Code in Text Widget Does NOT Show

I have a self hosted Wordpress 3.7 and using the Twenty Thirteen theme. I have placed a text widget on the sidebar and put a simple code from Amazon inside it: <SCRIPT charset="utf-8" ...
3
votes
1answer
37 views

Listing registered scripts

Back story : We have a number of wordpress web sites experiencing issues when viewed on some IE8 browsers. The errors include the page loading but not being displayed (either a blank screen is ...
2
votes
3answers
2k views

How to prevent wordpress from loading old versions of jquery in wp_head();?

I noticed my twenty twelve theme is including outdated versions of jquery and js so I want to replace the scripts with the newer versions, however the scripts are in the file included by wp_head() ...
0
votes
1answer
57 views

JavaScript Libraries in WordPress

I understand that in order to use a JavaScript library in WordPress, such as jQuery, we have to use the following code to prevent conflicts: function my_scripts_method() { wp_enqueue_script( ...
2
votes
2answers
2k views

How to load JQuery easing script in wordpress?

Ok, first of all, I know how to do this manually. I could just download easing, place it in my plugin folder and load it using wp_enqueue_script. However, I want to load my script in a long-term way, ...
0
votes
1answer
23 views

Is there a way to include some external script to some or all pages in a wordpress site?

My current requirement is to stick a countdown timer on the top of every page or on the side of all pages. But since i get too many requests like this, i was looking for a technique with which i can ...
1
vote
1answer
110 views

how to put a custom field value in variable

function zh_get_invoice_round_off_number() { global $post; return get_post_meta($post->ID, 'invoice_round_off_number', true); } function zh_invoice_round_off_number() ...
0
votes
1answer
115 views

setting featured image is not working while running script in background, works when running that script from browser

I have creted a script which will fetch content from one of my site and automatically create new post in my wordpress blog. When I am running that script from browser, its working really cool! post ...
0
votes
2answers
342 views

How to connect rating to individual comments?

I have managed to make my own custom comment rating system - that was working fine until now. I got an idea: why not add star rating to individual comments? I thought it would be easy as I have ...
0
votes
1answer
72 views

Automatically add a character to field in edit post page

Currently I am facing an issue involving making two plugins work well together. I am using a form plugin called formidable to create a new location custom post (custom post was made from a plugin ...
2
votes
2answers
164 views

Add a script as a dependency to a registered script

wp_register_script() (see codex) allows you to specify dependencies: scripts that must be loaded before the one being registered is loaded (if it is loaded). But suppose the script is a third-party ...
0
votes
1answer
229 views

How to add GET variable after script url?

So, I've registered and enqueued my script. http://mysite.com/wp-content/plugins/my-plugin/script.js?ver=3.6 But how do I add a GET variable on the script src url? ...
0
votes
0answers
176 views

wordpress video sharing clone script?

Is there any wordpress video sharing clone script like youtube? i have seen many, but they only allow the admin to upload videos, i want a script where users can register and upload their videos other ...
1
vote
0answers
58 views

How to load script-related styles automatically?

Scenario: It is common that a JS dependency is bundled with a style file to work properly (just think about your favorite slideshow jQuery plugin). AFAIK, in this situation, the script and style have ...
0
votes
1answer
259 views

Load plugin scripts and styles only on plugin page

Hello wordpress users, I'm stuck with a problem while running 2 self made Wordpress plugins. I'll use the following code : define('PLUGIN_URL', plugin_dir_url( __FILE__ )); add_action( ...
0
votes
2answers
46 views

How to Access Script Tags in Header

IN my Wordpress blog, I am looking to update a link in header that I believe is outdated: <script type='text/javascript' ...
0
votes
1answer
1k views

Javascript block in Twenty Twelve theme

I am authoring a WP plugin, and I have to generate some JS (jQuery) code in "realtime". It is working fine in general, though I've stuck with one problem with the WP 3.5.1 and its default Twenty ...
1
vote
1answer
967 views

Add conversion/tracking pixel to <head> section for specific post

I need to add a tracking pixel for a Facebook ad to my Wordpress site. It should only be active for one blog post, not for every page on the site. How can I get the script into the HEAD section for ...
0
votes
1answer
59 views

why quotes shown in Wordpress?

I have written a function to register a script in the admin interface. function custom_admin_js() { $url = get_bloginfo('template_directory') . '/admin/admin.js'; echo '<script ...
1
vote
1answer
353 views

Some way to Flush or Overwrite all Imported Content in a Site for a Fresh Import - How?

Some way to Flush or Overwrite all Imported Content in a Site for a Fresh Import - How? Is there an easy quick way to do this? To delete all Pages, Posts, Comments and stuff that got imported? Or ...
2
votes
1answer
490 views

How do I enqueue(or delay loading of) <script> tags in individual page posts?

My customer has many pages with <script> elements including javascript. <script src="myscriptforthispageonly.js"></script> I'm trying to get all scripts to load in the footer ...
0
votes
1answer
142 views

How do I pass $in_foooter to wp_enqueue_script() without passing other params?

I have some scripts that I'm enqueueing like this: wp_enqueue_script("jquery"); wp_enqueue_script("myscript" , get_template_directory_uri()."/js/myscript.js", Array('myscript'), " "); I want to ...
0
votes
2answers
405 views

Including javascript for a shortcode

I'm creating a plugin that allows a user to use a shortcode. This shortcode depends on a bunch of javascript that needs to be present once the shortcode loads. I'm having issues trying to decide when ...
0
votes
1answer
583 views

Generate featured images old posts

I am looking for a way to generate featured image per post based on the first image in the post for old posts without a set featured image. I'm switching from handmade thumbnails to auto generated ...
-2
votes
3answers
81 views

Why is jQuery not working properly? [closed]

I've enqueue'd jQuery from Google and it's displaying in the source code but no matter where I put my scripts they don't seem to work. Here is the site in question - http://www.deanelliott.me/handh/ ...
0
votes
2answers
349 views

Is it possible to add posts and images (auto resize) for custom post types with a script?

I have a specific need to import many post with featured images into a custom post type. The issue is, I need this to be a script because it runs off of another system that collects all the data. I ...
0
votes
2answers
144 views

Minimizing scripts & css files that plugins add

I try my best to limit plugin usage and only use ones that are well designed. But I still find that many will load a lot of extra scripts and styles, and few have options to load selectively based on ...
0
votes
1answer
338 views

Socialite not displaying icons [closed]

I was looking into using Socialite.js to load my twitter/facebook icons. I found the following tutorial, which helped me to build the desired functionality. The links display, but just as text (with ...
0
votes
2answers
960 views

Setting Variable Path to Template Directory inside Script

I have HTML5 Template with 5 pages. I am converting it to a WordPress Theme. I have a contact page. This page includes 'forms.js' script to send contact form data to 'MailHandler.php' file. Inside ...
0
votes
2answers
175 views

Serving wp-includes (front-end) javascript from a different domain?

The WordPress Codex points to an extremely simple way to change the URL of the wp-content directory, which is, adding this in wp-config.php: define( 'WP_CONTENT_URL', ...
0
votes
2answers
162 views

Add script into front from my plugin

I have a WordPress plugin, and I must load scripts from my plugin to the front of the site. class My_Plugin { function __construct() { add_action('admin_menu', array(&$this, ...
3
votes
1answer
2k views

How do I get the $handle for all enqueued scripts?

Is there some way to get the $handle for each script that has been enqueued? Is there some array that holds all the handles so that I can loop through it and do something using each $handle?