Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

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?
0
vanyab
Asked:
vanyab
  • 3
1 Solution
 
TomMicrosoft ISV PartnerCommented:
Copy your theme template to a new name, modify this and apply it to the page.
0
 
TomMicrosoft ISV PartnerCommented:
When you have found the template you want to copy change the template name here:
_________________________________
<?php
/*
Template Name: NEW_NAME_HERE
*/
get_header(); ?>
__________________________________

Now you can select the new template when you edit your page
0
 
vanyabAuthor Commented:
Simple. Thank you.
0
 
Jason C. LevineNo oneCommented:
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.
0
 
TomMicrosoft ISV PartnerCommented:
My pleasure :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now