LESSON 01 / 04

How WordPress Builds a Page

From URL to finished HTML: WordPress loads, figures out what was asked for, queries the database, picks a template from your theme and runs it.

๐ŸŽ“Mediumlevel
โฑ๏ธ30 minto finish
โœ๏ธ1activities

๐Ÿ“‚ How Themes Work๐Ÿท๏ธ WordPress

๐ŸŽฏ By the end of this lesson you canโ€ฆ

  • Describe the WordPress request lifecycle
  • Explain the role of the theme vs plugins
  • Set up a local WordPress site

A request, step by step

  1. 1Visitor opens /blog/hello-worldthe web server hands the request to WordPress (index.php)
  2. 2WordPress loadscore, then active plugins, then your themeโ€™s functions.php
  3. 3It works out the question“a single post with the slug hello-world”
  4. 4It queries the databaseand gets the post
  5. 5It chooses a templatefollowing the template hierarchy (e.g. single.php)
  6. 6The template runsthe Loop prints the post inside your HTML
๐Ÿ’ก Concept check
Which should control the colours and layout of a site?

๐Ÿ“Œ Key takeaways

  • Themes control how things look; plugins add what things do.
  • WordPress runs: load core โ†’ plugins โ†’ themeโ€™s functions.php โ†’ query โ†’ template.
  • Use a local tool like LocalWP to experiment safely.

Finished reading & practising?

Saved in this browser. Create a free account to keep it forever.