
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:
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.
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:
In this lesson we look at how to run WordPress locally using DesktopServer from ServerPress.
In this lesson we look at how to run WordPress locally using Local from Flywheel.
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.
Learn to pull a live WordPress site from production to staging and to local development using a staging setup, the all-in-one migration plugin, and URL adjustments.
In this lesson we introduce this section on PHP for WordPress and go over what we will learn in the coming lessons:
Next up we answer the question, "What 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:
Next up we practice writing some PHP.
In this lesson we start to write some basic PHP.
Covered in this lesson:
Next up we learn some more PHP 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.
In this lesson we work on the following practice exercise:
Try practicing this on your own before checking out the completed solution and the walk through in the video.
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:
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.
In general you will find three general types of PHP files in WordPress:
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 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.
Now it's time to practice using PHP Loop on your own:
Try tackling this on your own then follow along with me as I show you the approach I took.
Template tags are special functions that allow us to easily get information and content from WordPress.
Some popular template tags include:
Now that we've learned about template tags, it's time for you to tackle some practice on your own:
After you take a stab on your own, you can follow along with my solution :)
Conditional Tags are WordPress functions that return true when certain conditions are met.
Some common conditional tags include:
Now that you've learned about Conditional Tags, let's try practicing writing some:
Hooks allow you to add custom code into existing software.
Two types of hooks exist in WordPress:
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 );
?>
```
Now it's time to practice writing some hooks on your own.
Try the following:
Some important points for review:
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
Parent Theme
In this lesson we take a look at a child theme in action.
Now it is time for you to practice making a child theme:
Starter Theme Basics:
In this lesson I encourage you to go practice working with a starter theme on your own:
Child Theme Review:
Explore the WordPress template hierarchy and how templates like page.php, single.php, category.php, and tag.php control content display, with fallback to index.php when templates are missing.
Break up the theme's loop into modular, reusable pieces using template parts, content.php and content-none.php, organized in a template-parts folder and loaded with get template part.
Explore the WordPress template hierarchy by using single post templates, explain when to use single.php versus single-post.php, and how custom post types like portfolio affect fallback behavior.
Learn to integrate a comments.php template into your WordPress theme, load and style post comments, and conditionally display them when comments are open or closed on single posts.
Learn how to implement WordPress post formats, use get post format and get template part to create format-specific templates like gallery, video, and quote, with practical testing and dashicons cues.
Learn to implement home.php as the blog homepage, toggle latest posts or a static page, and convert the loop into linkable excerpts with permalinks, pagination, and template variations.
Learn how archive.php powers WordPress category, tag, and author archives by copying home.php, creating a generic archive template, and implementing fallbacks to index.
Explore how to build and load single pages for custom post types in WordPress, using single-portfolio.php, fallback to single.php and singular.php, and integrate custom fields with Advanced Custom Fields.
Learn to append the custom post type slug as a hyphen suffix to a portfolio template, use template parts to avoid duplication, and style with body classes or post IDs.
Master how to load multiple CSS files in a WordPress theme by enqueuing styles, managing dependencies with the main CSS, and optionally including external fonts.
Master the WordPress template hierarchy, including index.php as the fallback, and learn to implement headers, footers, sidebars, widget areas, custom templates, archives, 404 and search pages, and front page behavior.
Explore general template tags in WordPress, including include, login, blog info, archive, calendar, and miscellaneous tags, and preview how we’ll examine their functions in upcoming lessons.
Explore WordPress login tags, including login out and log in out, login url, log out url, and login form, and learn to display them dynamically with is_user_logged_in and optional redirects.
Practice building a WordPress theme from scratch using header, footer, and sidebar include tags. Load functions.php and style.css, display blog info, and add a sidebar with login/logout, calendar, and archives.
Practice building a WordPress theme by including header, sidebar, and footer, using bloginfo for site details, login/logout options, a calendar and archives in the sidebar, and archive titles.
Practice implementing navigation tags by configuring header and footer menus, defining main and footer theme locations, and adjusting depth and callback settings in functions.php for two distinct menus.
Learn how body class and post class template tags add CSS classes to your WordPress theme for custom styling and semantic information.
Explore the most common WordPress post tags, including ID, title, content, excerpt, category, and tags, and learn how to use their parameters and wrappers in themes and queries.
Learn to use WordPress date and time tags, apply PHP date formats, and handle listing behavior when dates repeat to display accurate post metadata.
Explore the difference between get_ and the_ prefixed WordPress template tags, learn when to echo versus return values, and how to use get_the_title and related functions in themes and plugins.
Practice implementing WordPress tags by adding body and post classes and rendering title, content, and date or time. Set up previous and next post links on listing and single views.
Master enabling and displaying post thumbnails for posts, pages, and custom post types via functions.php, using theme support and template tags like the_post_thumbnail and has_post_thumbnail.
Enable post thumbnails in your WordPress theme and display them on listing and single pages using thumbnail tags with proper size and alignment, while choosing echo or get appropriately.
Explore WordPress link tags in depth, from permalinks and get permalink alternatives to editing and deleting post links, and to home, site, search, and RSS links.
Explore how WordPress handles common comment tags, including author, avatar, date, time, text, and IDs, plus nested threaded comments, replies, pagination, and open/closed settings.
Practice wiring WordPress comment templates with a custom function and a WP list comments callback to load templates, enable reply scripts, and explore styling, nesting, and pagination.
Master author tags and get author meta to display display name, user login, email, nickname, first and last name, avatar, and author archive links in WordPress themes.
Master sanitization, escaping, and localization in WordPress to secure data and enable translations with template tags. Sanitize input before storage, escape output for safety, and localize with translation hooks.
Discover how do_action and add_action hooks work in WordPress core, and learn to locate and hook into actions like admin head and delete post.
Explore WordPress action hooks using the debug bar and debug bar actions and filters plugins, viewing core and plugin hooks and the admin bar and footer renders.
Explore how WordPress action hooks work, and learn to create custom hooks with do action, then connect to core hooks and practice with widgets, loop, template redirect, and save post.
Learn to create and hook into WordPress action hooks with do_action, attach footer functions, and load templates using locate_template for cleaner, extensible themes, child themes, and plugins.
Learn to discover functions hooked into WordPress filters using $wp_filter, exploring content and excerpts as they pass through filter chains, with priorities and practical hook creation.
Explore how the Simply Show Hooks plugin reveals which functions are hooked into filter hooks on both the front end and back end of WordPress, with search and toggle options.
Learn to hook into the WordPress the_title filter, format titles in the loop with a WP Tags Title Markup function, and return adjusted titles as h1 or h2 with links.
Explore the content filter in WordPress by hooking into the_content to insert an ad after the middle paragraph, using PHP, preg_match_all, and a loop check.
Explore how the excerpt_more filter customizes the end of WordPress excerpts by creating a custom read more link with the post permalink, while safely escaping HTML.
Practice selecting three WordPress filter hooks from documentation or WordPress core, implement custom functions, and customize examples to fit your goals, preparing for the next lesson.
Explore the shift from theme development to plugin development in WordPress, comparing functions.php versus plugins and showing when to extract functionality into a standalone plugin.
Explore how to set up WordPress plugins from a single php file to a matching directory, ensuring unique names, security checks, includes, and basic activation.
Learn how to craft a WordPress plugin header: a PHP comment with name, URI, description, version, author, license, text domain, and domain path, visible in admin and repositories.
Learn to build plugin settings pages in WordPress by hooking into the admin menu, using add_menu_page, defining slugs and capabilities, and creating a callback to render secure, translatable admin markup.
Explore building plugin settings sub pages in WordPress, adding sub menus to the main plugin page or existing admin menus. Create pages with callbacks and slugs.
Learn how to add a direct settings link from the plugin listing using the plugin action links filter, improving access to WordPress admin settings.
Master a WordPress plugin setup with a comment header, admin settings, and a footer; load scripts and styles only on plugin page and prepare for saving options to the database.
Explore saving complex data in WordPress by storing arrays in the options table. Learn how to use named arrays, update and get options, and understand serialized arrays in the database.
Learn how to use the Settings API to build admin forms that edit options in WordPress, including creating sections and fields, adding pages, and saving data to the options table.
Learn how to add setting sections via the Settings API in WordPress, activate our settings section plugin, and configure titles, descriptions, and page associations.
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.