im almost done with my first wordpress site. im using a page as my front page.
so how exactly do you style pages? i made a special template page-home.php for the home page and i have the basic loop in there to show the page which is created inside the page editor in the wp admin.
is that how it is suppose to be done? or do people not even include the loop which means the page is really totally disconnected from wordpress.
now to style it, I can put inline styling into the page editor in wordpress, what do others do? In the page template I can change the html only so much to output the post (or I should say page) differently then regular posts.
how do others make static pages?
edit: i just discovered art direction plugin. looks like an answer but feel free to give your own. also if i use styling in the header i dont think that css will be cached so if I use a cache plugin, I will still not have a front page thats cached.
You can use the body_class() function to add different classes to the body tag. That will enable you to specifically target your page type in your css file.
Firstly, I personally wouldn't worry about using a caching plugin until you're more comfie with working with your theme. The nature of caching means you won't see CSS / template changes very easily.
Next, like TheDoc said, check your header.php file for the < body> tag, and make sure it reads
<body <?php body_class(); ?>>
That way, you'll have a class that's different for different types of content ( ie, the home page gets a .home class, the main blog index gets a .blog class, other Pages get .page, single posts get .single, and so on).
Then you can style specific items or entire pages based around CSS in your style.css file like:
body.home p {color:red;} body.blog p {color: blue;}
That's how you do what you're asking, generally. The next step is learning CSS well enough to answer questions like this. :)
I have been using post_class() to do this and i think I will stick with it because nothing else changes except whats inside the post or page. everthing in header and other stuff is the same.
im using a page as my front page.
so how exactly do you style pages?
i made a special template page-home.php for the home page and i have the basic loop in there to show the page which is created inside the page editor in the wp admin.
is that how it is suppose to be done?
or do people not even include the loop which means the page is really totally disconnected from wordpress.
now to style it, I can put inline styling into the page editor in wordpress, what do others do?
In the page template I can change the html only so much to output the post (or I should say page) differently then regular posts.
how do others make static pages?
edit: i just discovered art direction plugin. looks like an answer but feel free to give your own. also if i use styling in the header i dont think that css will be cached so if I use a cache plugin, I will still not have a front page thats cached.
but what if you have different pages that have totally different looks?
Next, like TheDoc said, check your header.php file for the < body> tag, and make sure it reads
That way, you'll have a class that's different for different types of content ( ie, the home page gets a .home class, the main blog index gets a .blog class, other Pages get .page, single posts get .single, and so on).
Then you can style specific items or entire pages based around CSS in your style.css file like:
body.home p {color:red;}
body.blog p {color: blue;}
That's how you do what you're asking, generally. The next step is learning CSS well enough to answer questions like this. :)
I have been using post_class() to do this and i think I will stick with it because nothing else changes except whats inside the post or page.
everthing in header and other stuff is the same.
ok thanks!
If you're doing things right, it should be extremely useful.