Complete WordPress Theme & Plugin Development Course
- Description
- Curriculum
- FAQ
- Reviews
![5420](https://elearn.zorarte.com/wp-content/uploads/2023/09/1178762_ac09_3.jpg)
WordPress is the leading Content Management System on the market, powering a large percentage of the Web.  The need for WordPress Developers who can build and customize themes and plugins is ever growing.  Learn from one of the most recognized educators in the WordPress world, Zac Gordon, who has taught thousands of people now employed as WordPress Developers.
If you want to learn everything from customizing existing themes, building custom themes or starting to build plugins, this course is for you.  You will learn in depth how WordPress works under the hood, from template files and tags to hooks and internal APIs.  If you are looking to build bigger and more custom projects with WordPress or just get a good job with a great company building WordPress projects, then this course is for you.  Make sure though you can already build and style a basic web page with HTML and CSS as we assume you already know this and focus more on learning PHP.
When you learn the skills this course contains you will feel incredibly empowered to build almost anything you can imagine with WordPress.  You should also feel confident working professionally in the field as a WordPress Developer.  You will have built a theme and plugin along with the course as well as a theme and plugin of your own.  Follow in the path of thousands of others of Zac’s students who learned WordPress Development and went on to do great work in the field.
-
1Course Introduction
Welcome! Â In this first lesson we go over what we will learn in this course.
This course does not teach, but does use HTML and CSS, so we recommend you learn that first.
Overall the course covers the following topics:
- How to setup your local environment
- How to setup you hosting environment
- PHPÂ for WordPress (The Loop, Conditionals, Tags, Hooks, etc)
- How to work with Child Themes and Starter Themes
- The Template Hierarchy and Template Tags
- Action and Filter Hooks
- How to Start Building Plugins
- Internal WordPress REST APIs
Throughout the course you will follow along with me as I build a theme and plugin and have the opportunity to build your own theme and plugin as well :)
Next up we'll look at how to setup our local WordPress environment so we can run WordPress on our computer.
-
2Downloading and Using the Course Example Files
-
3Setting Up WordPress Locally
Local WordPress Development refers to running WordPress on your computer and editing the files locally, on your computer, rather than using a hosted version of WordPress to develop with.
We look at a few different options for locally running WordPress on our computers:
- DesktopServer from ServerPress
- Local from Flywheel
-
4Setting Up Locally
-
5DesktopServer from ServerPress
In this lesson we look at how to run WordPress locally using DesktopServer from ServerPress.
-
6Local from Flywheel
In this lesson we look at how to run WordPress locally using Local from Flywheel.
-
7Editing WordPress Files Locally
In this lesson we look at how to find the WordPress files that you will need to edit when you work with Desktop and Local.
-
8Setting Up Locally
-
9Introduction to Staging
-
10Pulling from Production to Staging to Local
-
11Pushing from Local to Staging to Production
-
12PHP for WordPress Introduction
In this lesson we introduce this section on PHPÂ for WordPress and go over what we will learn in the coming lessons:
- Explain what PHP is and how it works
- Write some PHP and learning the basics of the language
- Introduce important WordPress specific PHP things that are important to know about, like the Loop, Template Tags, and Hooks
Next up we answer the question, "What is PHP?"
-
13What is PHP?
In this lesson we learn the PHP stands for "PHP: Hypertext Preprocessor" and runs before the HTML for a web page is generated.  PHP runs a lot in WordPress and can be used outside of WordPress as well to build sites and applications.
PHPÂ Review:
- PHP is a programming language
- It runs on the server before HTML is sent to the browser
- PHP is used quite a lot in WordPress itself and in WordPress Development
- PHP can also be used outside of WordPress in other applications and web sites
Next up we practice writing some PHP.
-
14What is PHP?
-
15Writing Some Basic PHP
In this lesson we start to write some basic PHP.
Covered in this lesson:
- Opening an index.php file
- Writing a variable
- Echoing a variable
- Echoing a string of text
- Concatenating or combining variables and strings
Next up we learn some more PHP Programming Basics.
-
16PHP Programming Basics
In text lesson we outline some of the basics of working with PHP that are important for us to know going forward. Â Read through and absorb what you can and in the next lesson we will look at putting some of this into practice.
-
17PRACTICE - PHP Basics
In this lesson we work on the following practice exercise:
- Activate theme 1.4 PHP Basics (Starter)
- Create an array of post titles
- Loop through the array of posts
- Inside of the Loop, call a display_title() function and pass it the title as a parameter
- Have the display_title() function echo the title in an <h3> tag
Try practicing this on your own before checking out the completed solution and the walk through in the video.
-
18WordPress PHP Coding Standards
In this lesson we learn about the WordPress Coding Standards. Â
These are guidelines and suggestions for how to write and format your PHP when working with WordPress.
You can access the WordPress PHP Coding Standards here: https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/
The WordPress Coding Standards contain information around the following topics:
- Single and Double Quotes
- Indentation
- Brace Style
- Use elseif, not else if
- Regular Expressions
- No Shorthand PHP Tags
- Remove Trailing Spaces
- Space Usage
- Formatting SQL statements
- Database Queries
- Naming Conventions
- Self-Explanatory Flag Values for Function Arguments
- Interpolation for Naming Dynamic Hooks
- Ternary Operator
- Yoda Conditions
- Clever Code
- Error Control Operator @
- Don’t extract()
Not all of these may make sense to you at this point so try taking a read through these now and check back on them again at different points in the course.
-
19Different Types of PHP Files in WordPress
In general you will find three general types of PHP files in WordPress:
- WordPress Core Files - These control how WordPress works, not edited, but interesting and possibly helpful to read through or study.
- WordPress Theme Files - These control how themes work and display content.  When you are building or customizing a child theme you will definitely edit these files.
- WordPress Plugin Files - These are used when building plugins.  If you are writing your own plugin or extending another plugin you will edit these files, but you would not generally directly edit the code of another plugin.
- Include Files - Small PHP files that are included in larger files appear in Core, Theme and Plugin files.  You will likely come across and write them yourself.
-
20The Loop
The Loop is a combination of a conditional statement and loop that intelligently gathers and prepares post or page content to display.
It consists of the following:
- A PHP If Statement
- A PHP While Loop
- A special WordPress function call to get the correct post or page (or custom post etc)
A basic loop looks like this:
```
  <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
   <h2><?php the_title(); ?></h2>
   <?php the_content(); ?>  <?php endwhile; else: ?>
   <h2><?php esc_html_e( '404 Error', 'phpforwp' ); ?></h2>
   <p><?php esc_html_e( 'Sorry, content not found.', 'phpforwp' ); ?></p>  <?php endif; ?>
```
Notice that since the PHPÂ code is inside various self contained PHP blocks, it is also possible to use HTML inside of the Loop.
It is also possible though to have a pure PHP loop without any HTML being included between PHP blocks:
```
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();Â
   the_title( ’<h1>', ’</h1>' );Â
   the_content();
endwhile; else:Â
   _e( 'Sorry, no pages matched your criteria.', 'textdomain' );Â
endif; ?>
```
It is also possible to customize the Loop, which we will look at late in the course.
-
21What is the Loop?
-
22PRACTICE - The Loop
Now it's time to practice using PHP Loop on your own:
- Activate theme 1.8 – The Loop (Starter)Â
- Open index.php
- Code out The Loop
- Use the_title and the_content to display the content
- Display a 404 message using _e() if no content available
- Open a page or post from WP Admin to test
Try tackling this on your own then follow along with me as I show you the approach I took.
-
23Template Tags
Template tags are special functions that allow us to easily get information and content from WordPress.
Some popular template tags include:
- get_header()
- get_footer()
- get_sidebar()
- get_template_part()
- wp_login_form()
- bloginfo()
- the_title()
- get_the_title()
- the_content()
- the_author()
- the_category()
- the_tags()
- comment_author()
- the_post_thumbnail()
- the_permalink()
- edit_post_link()
- site_url()
- wp_nav_menu()
-
24PRACTICE - Template Tags
Now that we've learned about template tags, it's time for you to tackle some practice on your own:
- Activate theme 1.10 – Template Tags (Starter)Â
- Open index.php
- Add template tags inside The Loop
- Add template tags outside The Loop
- See how many different template tags you can get working!
After you take a stab on your own, you can follow along with my solution :)
-
25WordPress Conditionals
Conditional Tags are WordPress functions that return true when certain conditions are met.
Some common conditional tags include:
- is_front_page()
- is_home()
- is_admin()
- is_single()
- is_single( 'slug' )
- is_single( [ 'slug-1', 'slug-2', 'slug-3' ] )
- is_singular()
- get_post_type()
- has_excerpt()
- is_page()
- is_page( 'slug' )
- is_page( [ 'slug-1', 'slug-2', 'slug-3' ] )
- is_page_template( 'custom.php' )
- comments_open()
- is_category()
- is_tag()
- is_archive()
- in_the_loop()
-
26PRACTICE - Conditional Tags
Now that you've learned about Conditional Tags, let's try practicing writing some:
- Activate theme 1.12 – Conditional Tags (Starter)Â
- Open index.php
- Try adding conditional tags
- Open page from admin or visit site.dev/category site.dev/tag url directly
- Might need && || !
-
27WordPress Hooks
Hooks allow you to add custom code into existing software.
Two types of hooks exist in WordPress:
- Action Hooks let you run your own code when certain events take place in the WordPress run cycle.
- Filter Hooks let you modify how content is displayed on a page or saved to the database.
Here is an example of an Action Hook in use:
```
<?phpÂ
function my_theme_styles() {Â
   wp_enqueue_style( 'main-css', get_stylesheet_uri() );
}
add_action( 'wp_enqueue_scripts', 'my_theme_styles' );
?>Â
```
Here is an example of a Filter Hook in use:
```
<?phpÂ
function my_read_more_link( $excerpt ) {Â
   return $excerpt . '<a href="' . get_permalink() . '">Read more</a>';Â
}Â
add_filter( 'get_the_excerpt', 'my_read_more_link', 10 );
?>Â
```
-
28Intro to Hooks Quiz
-
29PRACTICE - WordPress Hooks
Now it's time to practice writing some hooks on your own.Â
Try the following:
- Activate 1.14 – WordPress Hooks (Starter)
- Open the functions.php
- Try enqueueing the theme CSS via an Action Hook
- Try adding a Read More link to the_excerpt() with a filter
-
30PHP for WordPress Review
Some important points for review:
- PHP is a server side programming language.
- Many Core, Plugin and Theme
files in WordPress are PHP. - Some basic PHP is required for WordPress Development.
- WordPress provides The Loop, Template Tags and Conditionals to make writing PHP easier.
- Action and Filter Hooks let us run our own code and modify data in WordPress programmatically.
-
31Chlid Themes v Starter Themes
A Child Theme allows you to override another theme (parent theme) without making direct changes that are lost during updates.
A Starter Theme includes helpful files and functions for building themes from scratch. You usually edit starter themes directly, not using child themes.
Here is when to use each:
- Child Theme - Customizing an existing theme
- Starter Theme -Â Building sites from scratch
-
32Child and Starter Theme Quiz
-
33Child Theme Basics
Child Theme
- Reference to parent theme in style.css file
- Include parent style in functions.php file
- Copies of any templates from Parent Theme you want to modify
Parent Theme
- Keeps all original files unedited
- Before loading a file, WordPress looks to see if exists in Child Theme
- Can be updated without affecting code in Child Theme
-
34DEMO - Child Theme
In this lesson we take a look at a child theme in action.
-
35PRACTICE - Child Themes
Now it is time for you to practice making a child theme:
- Pick a WordPress theme
- Create a Child Theme for it
- Modify the CSS and one of the templates
- You don’t need to make it look better, just get it working!
- Demo and Practice Child Theme filesÂ
-
36Starter Theme Basics
Starter Theme Basics:
- Include common theme template files
- No CSS styles (but some include Bootstrap / Foundation)
- Extra functionality in functions.php
- Extra hooks in template files
- Follow modular file architecture
- Some include workflow tools
- Usually edited directly, not via child themes
-
37DEMO - Underscore Starter Theme
-
38PRACTICE - Starter Themes
In this lesson I encourage you to go practice working with a starter theme on your own:
- Choose a starter theme (I recommend JointsWP)
- Install and Activate it
- Make a CSS change
- Make a change to one of the templates
- WARNING: Not all starter themes are created equal
-
39Child and Starter Themes Review
Child Theme Review:
- When customizing a theme use a Child Theme
- When starting from scratch use a Starter Theme
- Also possible to start with no child theme or starter theme!
-
40Child and Starter Theme Quiz
-
41An Introduction to the Template Hierarchy
-
42Setting up the Theme Content and Files
-
43Working with the style.css file
-
44Working with the functions.php file
-
45Working with the index.php template
-
46Working with Headers in WordPress
-
47Working with Footers in WordPress
-
48Adding Menus and body_class
-
49Adding Markup to a Theme - Part 1
-
50Adding Markup to a Theme - Part 2
-
51Adding Markup to a Theme - Part 3
-
52Working with Sidebars in WordPress
-
53Adding Widget Areas in WordPress
-
54Working with the Loop
-
55Creating Content Includes
-
56Working with the singular.php template
-
57Working with the single.php template
-
58Adding a single-post.php template
-
59Working with the comments.php template
-
60Working with Post Formats in WordPress
-
61The home.php for the Blog Homepage
-
62Working with archive.php and Archives in WordPress
-
63Working with the author.php template
-
64Working with author-id.php and author-nicename.php templates
-
65Working with Category Archive Templates
-
66Working with Date Archive Templates
-
67Working with Media Attachment Templates
-
68Mime Type Templates Further Explained
-
69Working with Page Templates
-
70Working with the front-page.php Template
-
71Working with Custom Templates
-
72Adding a 404.php template
-
73Working with Search Templates
-
74Working with Custom Post Type Archives
-
75Working with Custom Post Type Single Pages - Part 1
-
76Working with Custom Post Type Single Pages - Part 2
-
77Working with Custom Taxonomy Archives - Part 1
-
78Working with Custom Taxonomy Archives - Part 2
-
79Working with Multiple CSS Files
-
80Including JavaScript in Your Themes
-
81Working with JavaScript Dependencies (like jQuery)
-
82Template Hierarchy Review