Solved

Applying independent stylesheets to individual wordpress pages

Posted on 2015-01-02
5
183 Views
Last Modified: 2015-01-02
I need a way to independently style a singular page within a wordpress site without affecting the other pages.

methods?
0
Comment
Question by:vanyab
  • 3
5 Comments
 
LVL 9

Expert Comment

by:Tom
Comment Utility
Copy your theme template to a new name, modify this and apply it to the page.
0
 
LVL 9

Accepted Solution

by:
Tom earned 500 total points
Comment Utility
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
 

Author Closing Comment

by:vanyab
Comment Utility
Simple. Thank you.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
Comment Utility
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
 
LVL 9

Expert Comment

by:Tom
Comment Utility
My pleasure :-)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now