WordPress theme fundamentals: understand what all of these files do!
Lesson#2 of 13
in project
Theory
What all that files do?
- style.css: The main stylesheet. Contains theme information in a comment block at the top.
- index.php: The main template file. Required for every theme.
- functions.php: Theme functions file. Used to add features and functionality.
- header.php: Contains the site’s header section (logo, navigation, etc.).
- footer.php: Contains the site’s footer section.
- sidebar.php: Contains the sidebar content.
- page.php: Template for static pages.
- single.php: Template for single blog posts.
- archive.php: Template for archive pages (categories, tags, dates).
- comments.php: Handles the comments section.
- screenshot.png: Image preview of the theme (shown in the WP admin).
Themes may also include:
- 404.php: Custom 404 error page.
- search.php: Search results template.
- template-parts/: Folder for reusable template parts.
- assets/: For CSS, JS, images, etc.