[wordpress][solution] Which template files for which pages?


min read

My profile

Share this:

Which files in your template are related to which pages?
Read on below and you’ll have a complete overview !

PS: [u:7a57e9b5c8]If a file does not exist[/u:7a57e9b5c8] in your theme folder, wordpress will automatically choose [b:7a57e9b5c8]index.php[/b:7a57e9b5c8] as a template file

[*:7a57e9b5c8] [b:7a57e9b5c8]style.css[/b:7a57e9b5c8] – The main stylesheet. This must be included with your theme.
[*:7a57e9b5c8] [b:7a57e9b5c8]index.php[/b:7a57e9b5c8] – The main template. If your theme provides its own templates, index.php must be present.
[*:7a57e9b5c8] [b:7a57e9b5c8]comments.php[/b:7a57e9b5c8] – The comments template. If not present, wp-comments.php is used.
[*:7a57e9b5c8] [b:7a57e9b5c8]comments-popup.php[/b:7a57e9b5c8] – The popup comments template. If not present, wp-comments-popup.php is used.
[*:7a57e9b5c8] [b:7a57e9b5c8]single.php[/b:7a57e9b5c8] – The single post template. Used when a single post is queried. For this and all other query templates, index.php is used if the query template is not present.
[*:7a57e9b5c8] [b:7a57e9b5c8]page.php[/b:7a57e9b5c8] – The page template. Used when a page is queried.
[*:7a57e9b5c8] [b:7a57e9b5c8]category.php[/b:7a57e9b5c8] – The category template. Used when a category is queried.
[*:7a57e9b5c8] [b:7a57e9b5c8]author.php[/b:7a57e9b5c8] – The author template. Used when an author is queried.
[*:7a57e9b5c8] [b:7a57e9b5c8]date.php[/b:7a57e9b5c8] – The date/time template. Used when a date or time is queried. Year, month, day, hour, minute, second.
[*:7a57e9b5c8] [b:7a57e9b5c8]archive.php[/b:7a57e9b5c8] – The archive template. Used when a category, author, or date is queried. Note that this template will be overridden by category.php, author.php, and date.php for their respective query types.
[*:7a57e9b5c8] [b:7a57e9b5c8]search.php[/b:7a57e9b5c8] – The search template. Used when a search is performed.
[*:7a57e9b5c8] [b:7a57e9b5c8]404.php[/b:7a57e9b5c8] – The 404 Not Found template. Used when WordPress cannot find a post that matches the query.

[b:7a57e9b5c8]Read on / Source:[/b:7a57e9b5c8]

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *