-
Do i need to keep all the default WP templates files in a theme ?
Hello,
I have a general question about the themes development.
When I develop a theme for distribution (free or commercial) is it a better practice to keep all the default templates file in my theme even though i do not use all of them ?
For exemple if i develop a theme without blog feature, is it a good practice to keep single.php, comments.php ... files in my theme ?
I ask this question because when i test my themes with theme-check plugin, all the default templates files seems to be mandatory to pass the test.
What do you think, what is the best practice ?
Thanks for your advices.
Last edited by vauvarin; 11-25-2011 at 06:58 AM.
-
You do not need to include all templates. In fact very few themes do as there's quite a few of them.
If the theme does not support blogs, then there is certainly no point in having blog specific templates in there.
The only files a theme requires are an index.php and a style.css file. The rest are just bonus extras which you may or may not need depending on your specific theme.
-
In general, you should only include the template files you actually modify. Since all template files eventually fall back to index.php, you don't need to include any unmodified templates. So, if you're not doing anything unique for category archive index pages, you can leave out category.php. Likewise with all the template files listed in the Template Hierarchy.
However, the question of including/excluding basic WordPress functionality is a different matter entirely. I would strongly question your decision not to support basic blog-post functionality in your (intended-for-public-release) Theme, unless you are doing truly niche, truly out-of-the-box functionality with your Theme.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules