is_date example

                    $redirect_url = get_month_link( substr( $m, 0, 4 )substr( $m, 4, 2 ) );
                    break;
                case 8: // Daily.                     $redirect_url = get_day_link( substr( $m, 0, 4 )substr( $m, 4, 2 )substr( $m, 6, 2 ) );
                    break;
            }

            if ( $redirect_url ) {
                $redirect['query'] = remove_query_arg( 'm', $redirect['query'] );
            }
            // Now moving on to non ?m=X year/month/day links.         } elseif ( is_date() ) {
            $year  = get_query_var( 'year' );
            $month = get_query_var( 'monthnum' );
            $day   = get_query_var( 'day' );

            if ( is_day() && $year && $month && ! empty( $_GET['day'] ) ) {
                $redirect_url = get_day_link( $year$month$day );

                if ( $redirect_url ) {
                    $redirect['query'] = remove_query_arg( array( 'year', 'monthnum', 'day' )$redirect['query'] );
                }
            } elseif ( is_month() && $year && ! empty( $_GET['monthnum'] ) ) {
                
$classes[] = 'home';
    }
    if ( is_home() ) {
        $classes[] = 'blog';
    }
    if ( is_privacy_policy() ) {
        $classes[] = 'privacy-policy';
    }
    if ( is_archive() ) {
        $classes[] = 'archive';
    }
    if ( is_date() ) {
        $classes[] = 'date';
    }
    if ( is_search() ) {
        $classes[] = 'search';
        $classes[] = $wp_query->posts ? 'search-results' : 'search-no-results';
    }
    if ( is_paged() ) {
        $classes[] = 'paged';
    }
    if ( is_attachment() ) {
        $classes[] = 'attachment';
    }

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();
}

/** * Determines whether the query is for an existing day archive. * * A conditional check to test whether the page is a date-based archive page displaying posts for the current day. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 1.5.0 * * @global WP_Query $wp_query WordPress Query object. * * @return bool Whether the query is for an existing day archive. */
Home | Imprint | This part of the site doesn't use cookies.