Follow me on social media:

Stylesheet Per Page WordPress Plugin

Stylesheet Per Page WordPress PluginAdds a custom stylesheet/s all of the pages on your WordPress install with options to check for the existence of the stylesheet before adding.

Also allows for adding IE specific stylesheets all the way back to version 6. Just enable in the plugin options and add the stylesheets to your theme directory.

Download Stylesheet Per Page on the official Plugin repository. This is where the most stable version will be stored. Or, if you’re game clone this project at github and get stuck in.


  1. Upload the plugin to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

To use this plugin, just add stylesheets in the following formats to your theme’s base directory or a “css” subdirectory inside your theme’s base directory:

  • For pages create a file called page-[page_name].css where “[page_name]” is replaced with the slug of the page. Eg: page-about.css.
  • For author pages create a file called user.css and for individual user pages user-[username].css where “[username]” is replaced with the user’s login name.
  • For different post types user [post_type].css where “[post_type]” is replaced with the name of the custom post type. You can also use just ‘post’ for regular posts. Eg. post.css.
  • For individual posts use [post_type]-[post_name].css where “[post_type]” is replaced with the name of the custom post type or just ‘post’ for regular posts, and “[post_name]” is the slug of the post. Eg. post-10-tips-for-baking-pies.css, or, say if you had a “recipes” post type use something like recipes-classic-french-cheesecake.css.
  • To activate IE specific stylesheets just create css files with the following naming: ie.css (covers all IE versions), ie7.css (covers IE 7 and below), ie6.css (covers IE 6 and below).
  • To activate an iOS specific stylsheet create ios.css and enable in the plugin options.

NOTE: You can place your custom CSS files in either the base directory of your theme, or in a “css” subdirectory inside your theme, but try to be consistent with where you place them.

Revision History:

* 0.5 Added iOS specific stylesheet support and fixed option handling
– Fixed option handling to use a single option for easy handling throughout the plugin
– Added an iOS option for optionally printing ios.css for iOS devices.

* 0.4 Fixing a bug with stylesheet generation on custom post types
– Bug fix for sheets with no name appearing when using with custom post types

* 0.3 Adding support for IE specific stylesheets
– Added new functionality to allow optional generation of IE specific sheets

* 0.2 Initial code revisions
– Structured the code better
– Added a menu for the options page
– Improved commenting
– Added option to not print the stylesheet if the file doesn’t exist

* 0.1 Initial version
– Add a stylesheet for every page