Languages: English • 日本語 (Add your language)
This Conditional Tag checks if any type of Archive page is being displayed. An Archive is a Category, Tag, Author, Date, Custom Post Type or Custom Taxonomy based pages. This is a boolean function, meaning it returns either TRUE or FALSE.
<?php is_archive(); ?>
<?php
if ( is_archive() ) {
// write your code here ...
}
?>
is_archive() does not accept any parameters. If you want to check if this is the archive of a custom post type, use is_post_type_archive( $post_type )
Since: 1.5.0
is_archive() is located in wp-includes/query.php
.