
Many themes developer are loosing aprecious time while creating WordPress themes, because they redefine many CSS style which are already styled by default. In fact, WordPress provide a CSS stylesheet that you can use and save a big time!

Many themes developer are loosing aprecious time while creating WordPress themes, because they redefine many CSS style which are already styled by default. In fact, WordPress provide a CSS stylesheet that you can use and save a big time!
If you always wanted to be able to get default styling from WordPress basic elements as such as post images, smileys, the .alignleft, .alignright or .aligncenter css classes you just have to use the wp.css stylesheet.
Just click here to get a preview of what elements, ids and classes this css defines.
To include it on your theme, simply upload the file to your wp-content/themes/yourtheme directory and paste the following line on your header.php file, within the <head> and </head> tags:
<link rel='stylesheet' href='/wp.css' type='text/css' media='all' />
Thanks to Ian Stewart for the tip!
21 Responses
Never knew about that CSS file, looks like it’s hosted on Ian’s Google Code account.
I usually use the CSS code on this page, however Ian’s has a few more selectors.
Note that the code given will link to the
wp.cssfile at http://example.com/wp.css, which isn’t the location described just prior to the code in the post.The actual code should be
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/wp.css" type="text/css" media="all" />I can’t believe I never thought about this! This is very useful, especially when you try to align elements on left/right.
That’s not a stylesheet WordPress provides by default, it’s a stylesheet Ian Stewart provides by default.
Wow! Now I won’t have to redeclare .alignleft, .more-link, and the others now and then…
5 stars for this one!
This is a great tip and will save me some time. This is so simple that I never thought of it before.
I don’t understand why you want to put one more css file in your theme
I don’t think it can save time.
@V>C> : Seriously. I’m tired of those “I don’t understand” people. Why everyone else understands?
jajaja xD Take it easy, Jean. You´re so smart, dude. I ever enjoy yuor blog xD
Wowww… simple, but very useful tips. Thank you very much
What does this mean? Wordpress (self-hosted) comes with a style sheet included when downloaded, so if that is not the default, then what is this? What is the difference?
This tip save me a lot time. thx!
Thanks, very useful tips
Simple hack, that would save a huge amount of time…Thanks a bunch, guys!
I agree with V.C, there’s no need (and it’s not a good practice) to include another stylesheet file, you’re adding one more call to your pages and it affects the loading speed. It’s much better to copy the contents of the file to your theme’s style.css.
Trackbacks: