0

I'm learning wordpress.

In my archive.php I've several conditional tags such as :

if ( is_category() ) {
 ...
} elseif ( is_tag ) {
 ...
} elseif ( is_month) {
 ...
}

and so on

PROBLEM

I can't find a conditional tag to recognize custom taxonomies. What's the conditional tag for a custom taxonomy named 'zones'?

0

1 Answer 1

2

Archive.php is basically a catch-all according to the template hierarchy. Your taxonomy page should be taxonomy-zones.php. The function you are asking about is is_tax().

2
  • Now that I'm using taxonomy.php (instead of archive.php), what's the equivalent of WP_Query( 'cat='.getCurrentCatID() ) ? Thanks.
    – Kurt UXD
    Jun 10, 2012 at 7:53
  • that is done with the tax_query parameters for WP_Query. codex.wordpress.org/Class_Reference/… Jun 11, 2012 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.