murtaugh / HTML5-Reset-WordPress-Theme

A style-free WordPress theme to get you started with proper HTML5 semantics and structures.
1.1k stars 286 forks source link

Template/Stylesheet Paths #67

Closed ghost closed 11 years ago

ghost commented 12 years ago

TEMPLATEPATH and STYLESHEETPATH constants appear to be deprecated. Issue # 10 addressed such a site information instance, but other template part instances such as including meta.php and nav.php should be reviewed. Here is the relevant passages of the Wordpress Codex Theme Review:

Including Files

If incorporated into the Theme, custom template files are required to be called using get_template_part() or locate_template()

Site Information

If incorporated into the Theme, site information is required to be called using the correct template tag:

  • Template/Stylesheet Path:
    • Themes are required to use get_template_directory() rather than TEMPLATEPATH to return the template path.
    • Themes are required to use get_stylesheet_directory() rather than STYLESHEETPATH to return the stylesheet path.
Warkman commented 12 years ago

Good point, I will be interested in hearing any feedback on your info and why it has not been adopted before. I have always been told that Codex is the place to refer too.

On that note Codex states: include( get_template_directory() . '/file.php' ) must not be used to call Theme template part files (as you have pointed out above and seems to output an error if you do so).

http://codex.wordpress.org/Theme_Review#Template_Tags_and_Hooks


Other info of interest: http://lists.wordpress.org/pipermail/theme-reviewers/2011-August/006761.html

It would seem from the above that only if you are wanting to use some functionality with the constants otherwise it still works by using TEMPLATEPATH