WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

using function is_archive() we can know whether it is archive page or not.

But if it is archive page how can i find whether it is author archive page or category archive or date archive.

I have found this code in wp-includes/query.php

if ( $this->is_post_type_archive || $this->is_date || $this->is_author || $this->is_category || $this->is_tag || $this->is_tax )
$this->is_archive = true;

but dont know how to use it in wp_head action.

Based on archive page category or author or date archive, i want to out put specific meta tags in header.

Any help???

Thanks in advanced.

wordpress.stackexchange.com rocks!!

share|improve this question
up vote 1 down vote accepted

Use just the functions, not the object properties:

if ( is_post_type_archive() or is_date() )

There are many conditional functions (returning TRUE or FALSE) for exactly these cases.

share|improve this answer
brilliant.. i missed them completly.. Thanks exactly what i want. Will accept your answer soon. – Rajeev Vyas May 11 '13 at 12:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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