Is there an easy way to change the WP default template hierarchy?
For instance;
Say I want to change my theme directory structure so that it completely changes from the Template Hierarchy suggested here based upon conditionals:
http://codex.wordpress.org/Template_Hierarchy
If I wanted to make sure that for all page types (is_single()
is_home()
etc) it always opens one template file which then instigates my own pattern to provide the output?
Thanks very much!
Try this filter
The filename would be the file you would want to call in your theme folder. For child themes you would use
get_stylesheet_directory
instead.EDIT:
Or as suggested by Chip Bennett and what I too feel would be better; you can use the
template_redirect
hook in the following manner. The priority can be set accordingly if required.