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

Derek Hollister
Derek Hollister
537 Points

Static Site to WordPress Theme?

I have a static site built with HTML/SCSS/JS that I now need to convert(?) to a WordPress Theme. I've been following the WordPress Development track and honestly, am a little stuck as to where to start. I have most of the site built out (I say most because some pages are essentially templates for whole sections), including desktop and mobile navigation, sliders, etc.

Wordpress is just a tad overwhelming at first. I have some sections that I need to be customizable via WordPress and others that can stay static for the time being. Any recommendations on where to even begin?

For my next build should I use a WordPress template like _s?

2 Answers

Kevin Korte
Kevin Korte
28,149 Points

I'd just start at the front-page and work your way back. Follow the template hierarchy and start copying your static code into those templates.

You can than start to refactor in the areas you want the dynamic parts that wordpress add.

Derek Hollister
Derek Hollister
537 Points

That makes sense, thanks Kevin, I appreciate the help! Sounds like I'll just have to do a lot of copy/pasta.

Kevin Korte
Kevin Korte
28,149 Points

You do, only because wordpress only leaves you with having to basically do the html, css, and js of your fully cms site. Sure there is some php you might have to add, but it's specific and well documented functions inside the wordpress ecosystem, so it shouldn't be too hard to do.

Sounds like you have the hard part over.

Derek Hollister
Derek Hollister
537 Points

Kevin Korte - Phew, that's a relief then! So would you recommend for future builds going the route of building static-ly and then 'hooking up' WordPress or working differently?

Kevin Korte
Kevin Korte
28,149 Points

You can...it's whatever workflow you find easiest. I tend to build in wordpress, but build statically first, just get my templates right, and than start introducing the dynamic parts.

Unless I have something that 100% is dynamic. Than I just do it from scratch.

Derek Hollister
Derek Hollister
537 Points

That makes sense. Do you have any recommended resources for the workflow you follow? sorry for all the questions, I'm a bit new to the WP world.

Kevin Korte
Kevin Korte
28,149 Points

No worries on the amount of questions. I don't really, probably the best I could point you to is Css-Tricks. They talk about wordpress a lot there.

My process isn't pretty, it's back and forth a lot honestly.

I don't completely button down a design, because wordpress may interject it's own html and css, and I have to account for that. For instance, photo galleries. Wordpress has it's own markup for it. It will be different than you had your static files. There are ways to completely overwrite the default html output from WP in those situations, but it's a lot of work. Eventually you'll learn what type of things in wordpress will need special attention (photo galleries), and which other ones really don't.

Jose Balaguer
Jose Balaguer
17,473 Points

Are you doing that for adding a blog? Your html page doesn't work? I'm asking because if You only want to add a blog to your site you can:

  1. install WP in another directory;
  2. style the WordPress CSS matching your html page;
  3. and link the blog in your html navigation menu. If it's the case this will save you a ton of work.
Derek Hollister
Derek Hollister
537 Points

Long story short, I was under the impression that to build a wordpress theme, I'd have to build it static-ly and then somehow convert it with php tags. After building most of it, I found out otherwise and now feel kind of stuck. Most of the site should be editable, minus one or two pages that will be hard coded so the client can't screw with it.

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,253 Points

You will need a little bit of php knowledge but unless your site is going to bed dramatically different from the project in the Wordpress Theme Development course, you'll be able to look back at those videos to get an idea for what you need to do in each stage of your building.

It will give you an idea of what the template hierarchy is and how it links together.

It'll help you memorise the file structure in a Wordpress Installation.

How to edit code and which php tags to use to dynamically add content to your Wordpress website.

It's just going to take practice. :-)

Jose Balaguer
Jose Balaguer
17,473 Points

I've never done a conversion. Sorry :/