Solved

Applying independent stylesheets to individual wordpress pages

Posted on 2015-01-02
5
189 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 9

Expert Comment

by:Tom
ID: 40528774
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
ID: 40528781
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
ID: 40528784
Simple. Thank you.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40528786
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
ID: 40528789
My pleasure :-)
0

Featured Post

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The viewer will learn how to count occurrences of each item in an array.

695 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