My First WP Plugin – Per Post CSS & JS

I’m new to this whole Blogging thing (which is evident by the current state of the site), so it’s with great pride that I’m unleashing my first WordPress plugin into the world!

Per Post CSS and JS

One of the main problems that i’ve had while setting up my site has been the inability to display my CSS and Javascript experiments from within the post — instead having to link to an external file.

“Per Post CSS and JS” simply grabs links to CSS and Javascript files from WP’s custom meta field’s and links them into the header of that specific post. This plugin is based on the PPS plugin by BlindMuse.

Including a custom CSS file with a post

  1. Add a custom field
  2. Set it’s key value to be CSS
  3. Set it’s value value to the path of my CSS file, e.g. style.css

Including a custom Javascript file with a post

  1. Add a custom field
  2. Set it’s key value to be JS
  3. Set it’s value value to the path of my Javascript file, e.g. myCode.js

Download source code for Per Post CSS & JS WordPress plugin


About this entry