Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_taxonomy_template [ WordPress Function ]

get_taxonomy_template ( No parameters )
Uses:
Returns:
  • (string)
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ý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics