Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Creating Custom Pages (Wordpress)

Big problems here:

I've set CSS guidelines specific to the homepage of my blog, but when I click on any of the categories or metadata, the code gets used for those pages too and everything looks awful.

check it out for yourselves: http://matthewrgelfand.com/ <---click on any of the categories

How can I work around this? Can I create custom pages with different CSS?

3 Answers

Just refactor your code to only affect what you want it to, when you want it to.

If you currently have p { margin-right: 20px } and it's affecting all of your p tags, but you only want it to affect the p tags on the front page, maybe make a new class called .snippet, or .article-lead, or .story-sampler, just make sure that it makes sense to you. Then move the margin-right: 20px into the class selector you just created.

Right, but won't that interfere with Wordpress code?

It depends on the template you are using. Are you making your own? Here is a bare-bones starter template you can work with. (the solutions for designers that don't know Wordpress")

I'm using a custom template.

Ok, then check out the styles.css file and look for selectors that may clash.