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

Wordpress Code "Fighting" With My Static Code...

Nutshell: I created three static pages using a single style sheet, but I'm having significant trouble migrating my code into the Wordpress php because I have different CSS layouts for each page...

I've been told that my static code is "fighting" with the Wordpress code. Would anyone be willing to take a look?

Already having difficulty migrating page 1, but when I try to do page 2, it starts interfering w/page 1's code, and Wordpress' code too, totally screwing with the layout? Just beyond confused. CSS has styles for both pages on it.

2 Answers

John Locke
John Locke
15,479 Points

Hi Tom:

A quick way to fix this for the moment is to use WordPress' unique page-id class to override the CSS conflicts.

On the body element, WordPress generates a variety of CSS classes, such as post, page, and page-id-[insert page number here] .

Simply preface the conflicting selectors with the necessary CSS class selector until you can refactor your CSS and HTML.

James Barnett
James Barnett
39,199 Points

There's no way we can help without seeing your code. Post a link to the pages you are having trouble with.

[[ed. Note]] - moved the content of comment to the original post