[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Applying independent stylesheets to individual wordpress pages

Posted on 2015-01-02
5
Medium Priority
?
197 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 10

Expert Comment

by:Tom
ID: 40528774
Copy your theme template to a new name, modify this and apply it to the page.
0
 
LVL 10

Accepted Solution

by:
Tom earned 2000 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 10

Expert Comment

by:Tom
ID: 40528789
My pleasure :-)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

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

Before you approach an Ionic Mobile App development company for developing mobile apps using the ionic framework, you must know why you should choose the framework. Let's try to understand that through this article.
Magento is the best technology for eCommerce start-ups as it offers the technical expertise and visual appeal to create a store that pulls sales and earns high ROI (Return on investment).
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

590 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