The tag has no wiki summary.

learn more… | top users | synonyms

14
votes
7answers
298 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 ...
11
votes
2answers
511 views

Conditionally enqueue a widget's script/stylesheet in HEAD (only when present on page!)

I've been trying to load scripts and styles for a WordPress widget with the following conditions... The scripts MUST load in the HEAD (else they break). The scripts must ONLY load when the widget ...
7
votes
3answers
1k views

How can I create a bash install script for my Wordpress sites setup (WP+plugins+theme)?

I build a lot of websites with Wordpress, and my initial setup is basically always the same : Latest version of WP Latest versions of about 5 plugins My naked development theme Instead of ...
5
votes
4answers
2k views

dynamically add scripts to WP_Widget widget() method

I have a wordpress widget that has the standard outline like: class my_widget extends WP_Widget{ function my_widget(){ //do setup stuff } function form(){ //do form stuff } function ...
4
votes
2answers
1k views

Is it possible to change the attributes of a registered style or script before it fires?

I'd like to modify the properties of a registered style(or script - same applies) before it's been loaded. Right now i'm trying to modify a registered style just before it gets enqueued, so i can ...
3
votes
3answers
905 views

Editing Source Code in Wordpress

I am a senior in a college computer science program, and therefore have a decent knowledge of code and several languages. However, I am doing a summer internship type program, and the company I am ...
3
votes
2answers
263 views

What are the benefits of using wp_enqueue_script?

Is there any real benefit to using wp_enqueue_script on small self-managed sites? For instance, Modernizr, why enqueue it through a function rather than call it directly inside the document head? I ...
3
votes
1answer
35 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
2answers
117 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 ...
2
votes
1answer
337 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 ...
2
votes
1answer
71 views

Is there any free (or cheap) software that can be used for testing WordPress functionality?

Is there any free (or cheap) software that can be used for testing WordPress functionality? I would like to create some test scripts and then them against my self-hosted WordPress installation.
2
votes
1answer
404 views

Outputting Canonical Resource URLs Across a Multisite Network?

Say a theme "foo" is used on across a network of sites. In each site, all the theme resources (.css, .js, etc.) will have distinct URLs: http://network/siteA/wp-content/themes/foo/style.css ...
2
votes
2answers
245 views

Odd Script File Trying to be Loaded

This is an odd query I have and wondered if anybody can shed some light on it? We have a number WordPress multi-site (formally Mu) install, but on nearly all the sites on multiple installs we are ...
2
votes
1answer
191 views

How do you load WordPress from an external script when using MultiSite? [duplicate]

Possible Duplicate: Using WordPress functions on other sites I have an external script that needs to load up WordPress in order to have access to WordPress functionality. In the past I ...
1
vote
1answer
341 views

Question about the way that wp_register_script works

Ok so I'm using the Roots Theme for WordPress (https://github.com/retlehs/roots), which, is sort of a starter theme or theme framework. I'm confused about the way that it deregisters the WordPress ...
1
vote
1answer
1k 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?
1
vote
2answers
1k 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, ...
1
vote
2answers
49 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 ...
1
vote
1answer
870 views

Add stylesheets and js to template files when shortcode is used

After looking for days throught the net and no avail - i'd like to ask all of you guys. PROBLEM: i need to add custom code to the head of the file as part of shortcode use for my plugin. The same ...
1
vote
2answers
277 views

WXR slicing script

I have a massive WXR file im trying to import into wordpress. I run out of memory when i try to import as one file, so I'm thinking of how i can split the big file into smaller files programatically ...
1
vote
1answer
11 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 ...
1
vote
1answer
730 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 ...
1
vote
1answer
219 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 ...
1
vote
1answer
243 views

Help with enqueing scripts in footer after init action

In my functions.php, I have set a register_scripts() and load_scripts(), and hooked them to the 'init' action. I have registered all the scripts to be loaded in the footer, in order to optimize page ...
1
vote
1answer
643 views

Is there a way to list all the JavaScript scripts that are actually loaded by WordPress? Do we care?

This page on the Codex gives us a list of all the default scripts that ship with WP. But how do we know which ones are actually being used so we don't have to manually enqueue them? Or do we care, and ...
1
vote
1answer
532 views

Invision + Wordpress integration

I'm trying to integrate Invision Power Board into our website, Wordpress by using IPB Website Integration (IPBWI). I have used the script sometime before on a static website, but I'm having trouble ...
1
vote
1answer
66 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
57 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 ...
0
votes
2answers
839 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
2answers
41 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
2answers
316 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
492 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 ...
0
votes
2answers
130 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, ...
0
votes
1answer
165 views

Enqueuing a script before anything else

I wondered if it was possible to change the order in which a script is enqueued. I ask this because I wish to include the HTML5 enabling script but it needs to be included before any styles. Is ...
0
votes
1answer
942 views

How can I selectively print scripts to the footer of certain admin pages?

I'm using admin_footer-{$hook_suffix} to selectively print scripts on the new post page and comments page. This hook is depreciated in 3.1. I see there's an admin_print_scripts-{$hook_suffix} but ...
0
votes
1answer
323 views

What's a good way to unenqueue all scripts for a single template page?

I've found that my attachment templates are inheriting the enqueued scripts for single posts. My first instinct was to unenqueue these scripts one-by-one or to do an is_attachment() check before ...
0
votes
1answer
219 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
1answer
207 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
138 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
3answers
261 views

Display a consistent Google Plus icon on ALL pages of my site

My website is http://tablified.com and I have managed to setup the Google Plus script. The issue is that every page of the site displays a different Google Plus count. For example, if you go on my ...
0
votes
2answers
17 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 ...
0
votes
2answers
320 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
65 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 ...
0
votes
1answer
121 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
324 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
832 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
1answer
150 views

Removing admin javascript

I'm having some trouble adding jquery-week-calendar to WordPress' admin interface using add_menu_page and other API methods. What I found out is that the default jquery-ui and other JavaScript ...
0
votes
1answer
480 views

Wordpress Stats Plugin: Display Post Views

i'am currently using latest version of jetpack. So the stats plugin is also included in this plugin. But now i want to display the number of views the single post get on the single.php file using the ...
0
votes
1answer
98 views

Insert data through a script directly in the db

is it possible to insert data through a script or HTML site into the wpdb and this will show up as normal article in the, the same as when I use the 'create new post' page? Which tables are affected ...
0
votes
1answer
931 views

wp_enqueue_script() not working

I'm trying to add this social-network button: <a href="http://svejo.net/submit/?url=[your url]" data-url="[your url]" data-type="compact" id="svejo-button">Add in Svejo</a> ...