Link to home
Start Free TrialLog in
Avatar of vanyab
vanyab

asked on

Applying independent stylesheets to individual wordpress pages

I need a way to independently style a singular page within a wordpress site without affecting the other pages.

methods?
Avatar of Tom
Tom
Flag of Norway image

Copy your theme template to a new name, modify this and apply it to the page.
ASKER CERTIFIED SOLUTION
Avatar of Tom
Tom
Flag of Norway image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vanyab
vanyab

ASKER

Simple. Thank you.
Avatar of Jason C. Levine
Styling a page differently is easy.  Tom's instructions above are how to create a new page template and you can then alter the structure of the page.  However, different styles can easily be achieved because WordPress adds the postID to the top-level classes on pages and posts automatically and you can use that to create custom styles in the main stylesheet.  The Codex reference for this is here:

http://codex.wordpress.org/Function_Reference/body_class#Examples

That page contains an exhaustive description of the process as well as CSS samples.  Short version, you do something like:

.page-id-2 {
	/* styles for only page ID number 2 */
}

Open in new window


Where "2" is the ID of the page or post you want to customize.
My pleasure :-)