nitin
nitin

Reputation: 75

how to style different pages differently in wordpress

I have to add content to pages in a wordpress site. The problem is most of the page content have different styles. Do I need to create different css files for them?I read that page.php is the file which controls how each page is displayed. Do I need to add additional templates for other pages as shown here: http://wordpress.org/support/topic/how-to-have-a-separate-stylecss-for-each-page-template

Upvotes: 0

Views: 4102

Answers (2)

moffepoffe
moffepoffe

Reputation: 372

You can also create unique templates for each page.

Start with

<?php /* Template name: <name> */ ?>

The newly created template will appear on the right side of the content area where you will se "Template"

All the best, Marten

Upvotes: 1

Mehmet Yaden
Mehmet Yaden

Reputation: 287

Styling is a very general question; You can change colors of certain areas only or create completely different layout.

If it it is only font/color change -> open header.php of your theme and make sure that you have body class implemented.

<body <?php body_class(); ?>>

Doing that, you will have different ID for each page on yours site. So if your site's entry is wrapped by a class .entry -> you can view the source of page -> get the id of body and add something like

#page-99 .entry a {color:#c00} /* new color for lin */
#page-99 .entry, 
#page-99 .entry p,
#page-99 .entry ul,
#page-99 .entry ol{color:#44} /* new color for static text */

Otherwise rather than loading different style files, i would probably create different page template for each page.

Upvotes: 1

Related Questions