wordpress php template files

Here’s some notes I’ve gathered from working with wordpress templates.

archive.php, category.php, taxonomy.php etc

You need to use the normal wordpress loop in order to get wordpress to use its magic and bring out the native functionality of these template ie: “archive.php”.

If you use a custom Query in your “archive” template, like the one below. you will override the native wordpress functionality of that template. So “archive.php” will no longer act as a native, default archive page. It will act as your loop instructs it to.

home.php

WordPress will use the home.php when it’s set to display the latest posts rather then a static page. Home.php also serves as a default blog post template when you load the following url.

Custom taxonomy and custom term templates

Creating a template for a custom taxonomy is straight forward. Simply use the taxonomy name.

Creating a template for a custom taxonomy term is a little different as it uses the term slug not the name.

Return the current term of the custom taxonomy page being viewed

Comments are closed.