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.
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.
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.
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:
OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.
Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.
Find this site helpful? Tell a friend about us.
We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.
Your purchases help us maintain our catalog and keep our servers humming without ads.
Thank you for supporting OpenCourser.