Jump to content
Sign in to follow this  
tsalstrand

Page Specific CSS

Recommended Posts

tsalstrand    8
tsalstrand

Currently I'm putting all my custom CSS into the child theme's style sheet or occasionally putting it in the "custom code" area. Both work fine for site wide changes, however when I have to make a change to a specific page, it'd be nice to actually make that change on that page's "edit side." Somewhat similar to how we can add a page specific background image on that page in question, it'd be nice to have a "custom code" section so that I don't have to comment out the style sheet (like below) because I can't remember what each post ID goes with on a 70+ page site :-) It would help a lot with design teams made up of multiple designers working on one project.

/*BEGIN Home page CSS specific code*/
	body.page-id-17 .textwidget { background: white; box-shadow: 2px 2px 2px #bababa;}
	/*END Home Page specific CSS code*/

Share this post


Link to post
Share on other sites
catrina    103
catrina

Thanks for the suggestion. I can't say whether or not this feature will be added, but it's much easier to find the post ID and apply it the CSS (which is already what you're doing). You can find the IDs easily by following these instructions: http://tutzone.net/how-to-find-post-ids-in-wordpress/ (easier than having to view the source). If each page had its own stylesheet, I think site performance would be affected negatively. If there are too many stylesheets on a single site, that increases the number of http requests needed to load the page and that can cause your site to slow down.


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
tsalstrand    8
tsalstrand

Catrina, Considering that its my goal to get every site I work on under 1.5s load times, I'm surprised I didn't think of that! Excellent point and I agree with you 100%. Oh, you might like the plugin "WP Show ID"... it allows you to see all your post IDs at one glance, taking a lot of steps out :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×