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!!

1 Answer 1


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.

  • brilliant.. i missed them completly.. Thanks exactly what i want. Will accept your answer soon. May 11, 2013 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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