The PWS Head Loader WordPress plugin is designed to let one load necessary styles sheets and javascript only on the pages that need them.
By doing so, you can use heavy scripts for things like image galleries without slowing down all of the pages on your site that do not need them.
- Status: Beta
- Availability: Privateer Theme Owners
See your members products page to download.
Currently, the PWS Head Loader plugin is very solid, but remains in beta while I add in a few bells and whistles that I believe it needs.
As a beta plugin, it is freely available to Privateer Theme owners, but not yet available for sale to others.
Once I have it polished, it will remain free to Privateer Theme owners and be available for $5 or so to others.
The PWS Head Loader is a fairly simple plugin designed to let those who need processor intensive scripts and plugins load such scripts on specific posts, pages, and/or templates rather than loading them on pages that do not need them.
When you first activate the plugin, you will see a new menu in the WordPress admin panel under Tools, called PWS Head Loader.
By default, the PWS Head Loader plugin admin panel displays a list of the current entries that it takes care of, showing:
- The Entry ID – Database internal information
- Entry Name – The name that you have given the entry
- Load On – The pages, posts, and/or templates to load on
- Entered On – The date that the entry was made
- Options – Any options for the entry
Adding a new entry
To add a new entry, select the Add New Entry button, which will take you to the Add New HTML Header Lines page.
Here, you can enter the following items:
- Entry Title
A simple title to remind yourself what scripts you are loading with this entry. - Load On
A list of the posts, pages, or templates that you want the script to load on with commas between them.
Valid entries are- Numbers: The Post or Page IDs to load on
- ALL: Load on all pages
- HOME: Load on the Home Template
- SEARCH: Load on the Search Results page
- TAGS: Load on the various tag archives
- CATS: Load on the various category archives
- DATES: Load on the various date archives
- AUTHORS: Load on the various author archives
- FOUR: Load on the 404 template
- PAGE: Load on all single page templates
- POST: Load on all single post templates
- Script Content
Enter the html for loading or referencing any extra information you want in the header into this option.
For example, you might put a script tag to load a javascript file or a link tag to load a stylesheet.
When done, select Add New and you will return to the list of items to load and see your new entry there.
Editing an existing entry
Once you have entries in the system, you can select edit ( under options ) next to the entry that you want to edit.
The edit page looks exactly like the add new page, so you can simply make your changes and save them.
Removing entries
To remove an existing entry, find it in the list and select the Rem option.
The following functionality is planned for the release version of this plugin.
wp_enqueue_script and wp_enqueue_css
Currently, the theme requires links to add items to the header. While it is handy to be able to do such, it would also be nice to be able to use the built in wp_enqueue_ functions to load javascript and css…so I am currently working on that.
Disable
Currently, to disable an entry without deleting it, one needs to change the pages to load the script on to something that doesn’t exist.
Rather than doing this ( or deleting an entry ), the release version will have the option to simply disable / enable an entry.
Note for Privateer Theme Owners
This functionality will most likely be built right into the Privateer Theme soon. I’m not yet sure as to whether it will be in for 1.9 or wait until 2.0.








