[wp-hackers] taxonomy template, but which one i already see?

Andrew Nacin wp at andrewnacin.com
Thu Mar 17 17:21:24 UTC 2011


On Mar 17, 2011 11:15 AM, "Simon Blackbourn" <piemanek at gmail.com> wrote:
>
> I use this code (from an article by Justin Tadlock [1]):
>
> $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var(
> 'taxonomy' ) );
> echo $term->name;
>
>
> [1]
>
http://justintadlock.com/archives/2009/06/04/using-custom-taxonomies-to-create-a-movie-database

You should use get_queried_object() here, so core can do this internally.

Cheers,
Nacin


More information about the wp-hackers mailing list