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

Liam Roach
Liam Roach
16,787 Points

Should I learn PHP before WP?

I went through the front end dev track and I'm now working in a studio but a lot of our clients want Wordpress sites. What's peoples opinions on the order of tracks, would you do the PHP track followed by the Wordpress one or vice versa? Any other opinions on learning resources etc appreciated!

Andrew Milne
Andrew Milne
10,071 Points

I think knowing the basics of PHP is, if not important then at least helpful before delving in to Wordpress. Knowing what variables are, what loops are and if statements will all help Wordpress make a little more sense when starting out.

Im still in the process of learning PHP and Wordpress and I find each time I change from one to the other that it makes a little more sense than the last time I looked at it. You almost need to learn both at the same time and a lot of concepts will seem alien at first but just keep at it and it will gradually become clearer.

So, start with PHP basics, then move on to wordpress, when you get to a stage where you have no idea what the wordpress tutorials are talking about, go back to learning about PHP functions and objects, then go back to wordpress and eventually you will start to figure out the right questions to ask in order to get the results you want.

Hope that helps!

4 Answers

Nick Fuller
Nick Fuller
9,027 Points

In my humble opinion, you should learn PHP. If you're a Wordpress user/maintainer then you're fine not knowing php and just using Wordpress. But if you're going to be selling Wordpress setup services I think you should have a solid foundation on how to build a theme, and a plugin.

Now that being said, do you need to be the grand daddy of PHP? No. Absolutely not. In fact, you're perfectly fine being a novice to intermediate level user. But you do need a generally understanding of how things work and what Wordpress can and cannot do for you. You need to know when to extract things into a plugin, or when to incorporate them into a theme etc.

I would suggest getting familiar with the Wordpress codec. One of the best things you can do is learn how to format your code properly. Code formatting is crucial for multiple reasons, it is easier to read, easier to understand and truthfully, makes it look professional.

This quote from Linus Torvalds is a little out of context but applies:

"A human brain can generally easily keep track of about 7 different things, anything more and it gets confused. You know you're brilliant, but maybe you'd like to understand what you did 2 weeks from now."

So! My long suggestion is to read through the codec, and start with the PHP formatting. Then work through all of Treehouse's PHP courses.

Codec: http://codex.wordpress.org/

Style Guide: https://make.wordpress.org/core/handbook/coding-standards/php/

Andrew Shook
Andrew Shook
31,709 Points

I adamantly agree with Nick. You wouldn't try to read the Iliad in its original Greek from if you didn't know Greek? Well, WordPress is written in PHP, so you shouldn't try to write code for WP without knowing PHP. Also, echo what Nick said, you don't need to be a PHP expert, but you do need to be familiar with it. Best of luck.

Liam Roach
Liam Roach
16,787 Points

Thanks for the feedback everyone, I will go through the PHP track first.

After studying Codex and taking some Treehouse courses some online resources may help in the process of writing out your code with accuracy like :

GenerateWP has an archive of tool and code generators with helpful notes to help the workflow process.