Post JavaScript & CSS

The Post JavaScript / CSS plugin is a WordPress plugin that will allow you to attach JavaScript or CSS to individual WordPress posts.

Installation

You’re going to install this as a zip file rather than directly from the plugin browser. We have instructions on our website on how to do this.

Settings

When activated, this plugin will add a new menu item under the Settings menu in WordPress.

Post JavaScript / CSS Settings

Post Types

By default this plugin is active on posts and pages. If you’re using other plugins that add custom post types you can check them here if you’d like to be able to attach JavaScript and CSS to those posts.

Load Ace Editor

The plugin loads a JavaScript library called the Ace editor that handles the syntax highlighting when you’re entering JavaScript and CSS. If there’s a conflict between this and another plugin or your theme loading the Ace editor you can clear this checkbox and our plugin will use the Ace editor that’s already loading.

Odds are pretty good though that you’ll want to leave this checked.

Defaults

The options under defaults can all be overridden on individual posts. They’re just here as the setting that each post starts with.

Minify

When a post is saved the JavaScript and CSS is stored in both a normal and minified state. This let’s you pick which of those you’d rather load for your visitors.

Archive Pages

Normally you’ll probably just want the JavaScript and CSS to show up on individual posts. If you’d like it to also load on archive pages like your blog page, the date archive, tag and category pages, and the author archive you can select that default here.

One thing to watch though is the possibility of conflict between the JavaScript or CSS loading between multiple posts.

Script Position

Determines whether the JavaScript loads in the header of your page or just before the closing body tag.

Note that this only affects JavaScript. CSS is always loaded in the header.

Usage

You should find a new meta box on the post types that you selected under Settings. It looks like this.

There are two tabs across the top where you can edit your JavaScript and CSS.

Across the bottom of each editor are the options for your script and style for this post. They match up with the default settings from the section above.

Each also starts with a comment – /* Replace this text with your JavaScript */ in the screenshot above. If you leave this it will be stripped out and nothing will be inserted. You can also delete it if you don’t want scripts or styles to load, but you don’t have to.

Support

There’s a help tab in the meta box that will take you to our website if you’re needing help. You can also visit our support forums if you need help.

Download

Add to Cart

History

Version 1.0.0

  • Initial Release