Results 1 to 3 of 3

Thread: Do i need to keep all the default WP templates files in a theme ?

  1. #1
    vauvarin is offline Hello World
    Join Date
    Apr 2011
    Posts
    1

    Default 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.

  2. #2
    Ryan's Avatar
    Ryan is offline WordPress Legend
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,801

    Default

    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.

  3. #3
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    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.
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •