Title: is_date
Published: April 25, 2014
Last modified: February 24, 2026

---

# is_date(): bool

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#description)
 * [Return](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#wp--skip-link--target)

Determines whether the query is for an existing date archive.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#description)󠁿

For more information on this and similar theme functions, check out the [ Conditional Tags](https://developer.wordpress.org/themes/basics/conditional-tags/)
article in the Theme Developer Handbook.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#return)󠁿

 bool Whether the query is for an existing date archive.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#source)󠁿

    ```php
    function is_date() {
    	global $wp_query;

    	if ( ! isset( $wp_query ) ) {
    		_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
    		return false;
    	}

    	return $wp_query->is_date();
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/query.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/query.php#L361)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/query.php#L361-L370)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_Query::is_date()](https://developer.wordpress.org/reference/classes/wp_query/is_date/)`wp-includes/class-wp-query.php` |

Determines whether the query is for an existing date archive.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [_doing_it_wrong()](https://developer.wordpress.org/reference/functions/_doing_it_wrong/)`wp-includes/functions.php` |

Marks something as being incorrectly called.

  |

[Show 1 more](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#)

| Used by | Description | 
| [get_body_class()](https://developer.wordpress.org/reference/functions/get_body_class/)`wp-includes/post-template.php` |

Retrieves an array of the class names for the body element.

  | 
| [redirect_canonical()](https://developer.wordpress.org/reference/functions/redirect_canonical/)`wp-includes/canonical.php` |

Redirects incoming links to the proper URL based on the site url.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#changelog)󠁿

| Version | Description | 
| [1.5.0](https://developer.wordpress.org/reference/since/1.5.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/is_date/?output_format=md#comment-content-1617)
 2.   [Codex](https://profiles.wordpress.org/codex/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/is_date/#comment-1617)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_date%2F%23comment-1617)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_date%2F%23comment-1617)
 4. **Check if current archive is date archive.**
 5.     ```php
        if ( is_date() ) {
        	// Do awesome.
        }
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_date%2F%3Freplytocom%3D1617%23feedback-editor-1617)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_date%2F)
before being able to contribute a note or feedback.