get_taxonomy_template [ WordPress Function ]
| Uses: | |
| Returns: |
|
| Defined at: |
|
Retrieve path of taxonomy template in current or parent template.
Retrieves the taxonomy and term, if term is available. The template is prepended with 'taxonomy-' and followed by both the taxonomy string and the taxonomy string followed by a dash and then followed by the term.
The taxonomy and term template is checked and used first, if it exists. Second, just the taxonomy template is checked, and then finally, taxonomy.php template is used. If none of the files exist, then it will fall back on to index.php.
Source
<?php
function get_taxonomy_template() {
$term = get_queried_object();
$taxonomy = $term->taxonomy;
$templates = array();
$templates[] = "taxonomy-$taxonomy-{$term->slug}.php";
$templates[] = "taxonomy-$taxonomy.php";
$templates[] = 'taxonomy.php';
return get_query_template( 'taxonomy', $templates );
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/get taxonomy template « WordPress Codex
Description. Retrieve path of taxonomy template in current or parent template. Retrieves the taxonomy and term, if term is available. The template is prepended ...
codex.wordpress.org - #16375 (is_tax() and get_taxonomy_template() support for post ...
Two things it seemed we forgot. Currently you'd need to use is_tax() as a conditional tag for post formats. This is ugly, as it looks like this: is_tax(' post_format' ...
core.trac.wordpress.org - get_taxonomy_template | A HitchHackers guide through WordPress
Feb 12, 2011 ... function get_taxonomy_template() {}. Retrieve path of taxonomy template in current or parent template. Retrieves the taxonomy and term, if term ...
hitchhackerguide.com - get_taxonomy_template (WordPress Function) - WPSeek.com
WordPress lookup for get_taxonomy_template, a WordPress Function. wpseek. com is a WordPress-centric search tool for developers and theme authors.
wpseek.com