Templates in wordpress are files used to construct a website with data.
A template file contains HTML markups and PHP codes to insert data dynamically.
When a user requests a particular wordpress information (page, post, search, etc), wordpress:
- Prepares necessary data for display.
- Choose the corresponding template files to insert data
- Combines assets (CSS, JavaScript and images) and returns the requested webpage.