Welcome to WordPress programming. In this hands-on code building lab, you are going to get a gentle introduction into PHP programming. This lab assumes that you do not know anything about programming or PHP. You’ll start at the beginning and incrementally learn the major concepts and instructions you’ll encounter. It’s PHP 101.

When you open a theme or plugin, you see HTML, CSS, and PHP. That’s right, WordPress is built on the PHP scripting language. It runs on the server and handles the page request, talking to the database, processing forms, loading up different files, and handling the business logic to then render a response or new web page out to the browser.
What Will You Learn?
In this hands-on lab, you and I are going to ease into programming. You’ll learn about:
- What PHP is and why websites use it
- Why and How WordPress uses PHP
- Confused by files have HTML, CSS, JavaScript, and PHP in them. When is it PHP?
- What’s the deal with syntax
- Organizing code by breaking it up into files and subroutines
- Holding values in variables
- Determining whether to do some block of code or not
- Repeating code using loops
- Scoping – Who and what can talk to each other
- The order of stuff, what gets called when
- A gentle look at real WordPress-centric code
- and more
This lab is focused on teaching you the basics without the technical jargon or fluff. You are easing into programming and getting your feet wet with PHP.
Prerequisites
In order to do this lab, you will need a local sandbox site spun up and ready to go. I will walk you through it in the Lab Introduction episode. You’ll be using either the Genesis Sample or Twenty Seventeen theme.
Suggested Starting Point
I suggest that you take this lab first to introduce you to WordPress, HTTP, browsers and servers, how web pages are processed and handled, how WordPress loads up, and more. While it’s not required, it will help you to see the bigger picture of the website(s) you work on every day.
And if you are absolutely new to programming, take a look at the Absolute Beginners to Programming series.
As you progress through the lab, I’ll make suggestions and offer more opportunities for you to learn and grow.
Your best friend is code, Tonya is making the introductions.
Episodes
Total Lab Runtime: 03:21:32
- 1 Lab Introductionfree 11:37
- 2 What is PHP? Why use it?free 17:49
- 3 Why and how does WordPress use PHP?free 07:33
- 4 Syntax Basicsfree 18:34
- 5 What's the deal with Variables?free 27:05
- 6 Break Up Code into Logical Partsfree 07:55
- 7 Subroutines - Behold the functionfree 14:11
- 8 Loading Files to Runfree 13:20
- 9 To Run or Not to Run - Making Decisionsfree 19:07
- 10 Sequencing - Yup, code runs in orderfree 06:16
- 11 Repeating code using Loopsfree 13:57
- 12 Building Strings with Dots and Variablesfree 15:10
- 13 What's the deal with scope?free 08:34
- 14 Naming Stufffree 06:18
- 15 Putting it All Togetherfree 08:33
- 16 Where do I go from here?free 05:33
What to Do Next?
Other PHP Resources
A collection of other awesome educational resources.
Learn PHP – Codecademy
Codecademy has an interactive course that lets you write code as you learn. Check it out Learn more