Taxonomy queries and urls. Props andy. see #6357

git-svn-id: https://develop.svn.wordpress.org/trunk@7491 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-03-23 17:02:11 +00:00
parent 2377fb7ce0
commit cbfb5d78b5
9 changed files with 148 additions and 86 deletions

View File

@@ -381,6 +381,19 @@ function get_tag_template() {
return apply_filters('tag_template', $template);
}
function get_taxonomy_template() {
$template = '';
$taxonomy = get_query_var('taxonomy');
$term = get_query_var('term');
if ( $taxonomy && $term && file_exists(TEMPLATEPATH . "/taxonomy-$taxonomy-$term.php") )
$template = TEMPLATEPATH . "/taxonomy-$taxonomy-$term.php";
elseif ( $taxonomy && file_exists(TEMPLATEPATH . "/taxonomy-$taxonomy.php") )
$template = TEMPLATEPATH . "/taxonomy-$taxonomy.php";
elseif ( file_exists(TEMPLATEPATH . "/taxonomy.php") )
$template = TEMPLATEPATH . "/taxonomy.php";
return apply_filters('taxonomy_template', $template);
}
function get_date_template() {
return get_query_template('date');