|Separation of style and content||1:36|
|What are themes and how do they work?||2:17|
Big ideas here:
- All of your content is independent of the themes and widgets that you install. Themes don't affect content and vice versa
- This separation of style and content allows for maximum flexibility as you design new websites
- Quote from Video #2: diagrams the process by which templates become HTML pages
The templates in your theme are based on something called the WordPress Template Hierarchy: a system the application uses to pick the right template for the right type of content. In simple terms, a theme works like this:
- A browser is told to visit a URL that points at a specific database entry, say, entry #1706.
- We then go to the database and find the entry for 1706, and recognize that this is a post.
- Then, WordPress will go to the theme, and grab the single.PHP template, which is the template for regular posts, pop up the template, and find what's necessary, then pull the content that's necessary, so in this case, the post title, and place it into the post title area within the template, and finally build the page.
- This is the process that takes place every time someone visits your site, and all of this happens in a fraction of a second.