is_privacy_policy example


function is_privacy_policy() {
    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_privacy_policy();
}

/** * Determines whether the query is for an existing month archive. * * 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 month archive. */
if ( is_rtl() ) {
        $classes[] = 'rtl';
    }

    if ( is_front_page() ) {
        $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';
    }
Home | Imprint | This part of the site doesn't use cookies.