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

justinw
justinw
14,517 Points

WordPress Header Customization

What's the easiest way to change the header of my WordPress blog to match what's on my actual website. I for some reason am stumped on accomplishing this task without having to custom build my entire blog.

website: www.plantools.com (want to match this header) blog: blog.fraplantools.com

7 Answers

Does it have to be exactly the same? You could definitely make the Responsive Theme to look quite a bit like that with some css, and a full page slider. It has the 3 widgets at the bottom like the other one does, a main content area where you can add a slider. A place above the header to add the logo. For me, the most difficult part would be getting the menu to match exactly. Use Chrome Developer Tools to see the css on your page, and do your best to mimic it.

justinw
justinw
14,517 Points

Yeah that seems to be the best option. If I do this in the style.css file do you think it would carry over to all pages as well?

Kevin Korte
Kevin Korte
28,149 Points

When I was building a site for a small business that also had a blog, and wanted to have the blog look just like the site, instead of trying to make the wordpress site look like main site, I disassembled the pieces that make wordpress tick, and put those files and code onto the same framework of code the non-blog version I built.

For instance I took the wordpress loop code, comments code, etc and placed that code, and the necessary files onto the existings website's framework.

That way I wasn't writing css twice to basically accomplish the same thing. It also heavily reduced the amount of duplicated code, and....if I wanted to make changes to the header, footer, etc, since the blog code ran on the websites framework I could make those changes once and it was applied to both.

justinw
justinw
14,517 Points

Kevin Korte that's exactly what I'm trying to accomplish. It seems every file I alter doesn't adopt my new layout, now utilizing FireBug for a deeper dive. My struggle so far isn't the CSS but finding the same html file being used so I can update that content.

Kevin Korte
Kevin Korte
28,149 Points

It's very possible to do. I'll tell you it took me many hours to figure it all out, and once I got all of the big players working, I had lots of little issues and style problems I had to work through still. Matter of fact it's still not 100%.

Firebug is a must have tool I think, but it'll only get you so far. It can only show you the html code sent to the browser, it can't show you the php code you downloaded from wordpress that actually generated the html.

The thing that makes wordpress so confusing at first is also what makes it so flexible, and that's how broken up everything is.

What I did is I got a notepad, and starting listing all the files and code blocks on paper using squares that represented all of the big players in a wordpress page. The config file, the loop, the comments, etc. Drew lines to show myself what needed to be connected. Then I knew what I needed to bring over.

In the end it'll be worth it though because the client will be able to log into the admin wordpress, create a new post on the wordpress dashboard, ad pics if they want, and hit publish, and it'll post to the website and look as if that person actually knew how to write code.

It's all to be found in wordpress's php.

justinw
justinw
14,517 Points

Thanks for the response Kevin Korte . I updated my style.css file and the Headers.php file. Looks very ugly, but I now know I'm on the right 2 documents to change the top, just tweaking from here.

I can see it being a pain, but I'm sure after I spend the countless hours it will all make sense eventually. Got to love WP...

Enjoy the weekend.

Kevin Korte
Kevin Korte
28,149 Points

You're welcome.

Yep, gotta love WP sometimes. It kinda plays back to the idea of refactoring your code. As you learn more, you can start to clean everything up and remove duplicate code, and get to where your WP blog and regular site are running off of the same header.php, footer.php files, etc.

Good luck with it. Let us know!

Have a good weekend yourself.