Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
One of the real strengths of WordPress is its flexibility. You can easily switch the look and feel of your site to one totally different by activating a different theme. New pages can be quickly added for any special purpose. Content can be grouped by custom tags are categories added on the fly. However, all this flexibility comes at a price. WordPress is a pretty complex application. In this video I'm going to explain just how WordPress works so that you can get a better grasp of what your options are when creating a custom blog.
So the first thing that happens is a visitor requests an initial WordPress page: index.php. This starts the whole ball rolling as in viewing any web page. Next, WordPress activates the themes. This is actually the first line of executable code in the WordPress index.php file. Then WordPress works with a series of template files that are dynamically assembled together to create the desired page. So it must check to see which template files are present.
Then it gathers the settings that are stored in the database. This includes all default settings and any ones that have been customized like the title of the site. Next to it retrieves the specified number of most recent posts. The default is 10, but you can set how many posts you want to show through the dashboard settings screen. Then WordPress stores the post data in a variable. This includes data about the posts like the title, the author, the date of the posts, and links to comments--all of this otherwise known as metadata--as well as the content of the post itself.
Then it outputs the data onto a theme page according to the coded layout and CSS styles are applied. When you customize a theme this is where most of the work lies. As you can see, there's a lot going on here, and it all happens in the blink of an eye, and this is just for the homepage. WordPress is capable of displaying all types of pages, including those for single post, archives, post under a particular category, or with a specific tag. One of the key paths to developing custom WordPress blogs is to understand what happens when these and other types of pages are requested.
Remember this step where WordPress checks to see which template files are present? A theme doesn't have to have a specific file for every type of page. WordPress has a template hierarchy built-in that determines what to do if a needed file is missing. Let me give you an example. Let's say the site visitor clicks on the author's name--mine, in this example--to see all the posts that he or she have written. First WordPress looks to see if there's a template that combines the author prefix with the author's so-called nice name and uses that if there is.
If there's not, it looks for one with a user id. If that's not there, it tries to display the generic author.php template. Should that template be unavailable it looks for a theme specific archive.php, and if that's not there, it uses the index.php template, the original one. The WordPress template hierarchy covers all the different use cases. You can see a complete diagram in the WordPress.org site.
The template hierarchy gives web designers a tremendous degree of control. You can basically decide how much you want to fine-tune the structure and layout of your WordPress blog on a page by page basis. Now that you have a better understanding of how WordPress works in general you're ready to see how themes fit into that picture.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.