is_404 example


function _oembed_filter_feed_content( $content ) {
    return str_replace( '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"', '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"', $content );
}

/** * Prints the necessary markup for the embed comments button. * * @since 4.4.0 */
function print_embed_comments_button() {
    if ( is_404() || ! ( get_comments_number() || comments_open() ) ) {
        return;
    }
    ?> <div class="wp-embed-comments"> <a href="<?php comments_link(); ?>" target="_top"> <span class="dashicons dashicons-admin-comments"></span> <?php             printf(
                /* translators: %s: Number of comments. */
                _n(
                    '%s <span class="screen-reader-text">Comment</span>',
                    

function is_404() {
    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_404();
}

/** * Is the query for an embedded post? * * @since 4.4.0 * * @global WP_Query $wp_query WordPress Query object. * * @return bool Whether the query is for an embedded post. */

    if ( is_search() ) {
        $classes[] = 'search';
        $classes[] = $wp_query->posts ? 'search-results' : 'search-no-results';
    }
    if ( is_paged() ) {
        $classes[] = 'paged';
    }
    if ( is_attachment() ) {
        $classes[] = 'attachment';
    }
    if ( is_404() ) {
        $classes[] = 'error404';
    }

    if ( is_singular() ) {
        $post_id   = $wp_query->get_queried_object_id();
        $post      = $wp_query->get_queried_object();
        $post_type = $post->post_type;

        if ( is_page_template() ) {
            $classes[] = "{$post_type}-template";

            
if ( $redirect_url ) {
                $redirect['query'] = _remove_qs_args_if_not_in_url(
                    $redirect['query'],
                    array( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ),
                    $redirect_url
                );
            }
        }
    }

    // These tests give us a WP-generated permalink.     if ( is_404() ) {

        // Redirect ?page_id, ?p=, ?attachment_id= to their respective URLs.         $post_id = max( get_query_var( 'p' )get_query_var( 'page_id' )get_query_var( 'attachment_id' ) );

        $redirect_post = $post_id ? get_post( $post_id ) : false;

        if ( $redirect_post ) {
            $post_type_obj = get_post_type_object( $redirect_post->post_type );

            if ( $post_type_obj && $post_type_obj->public && 'auto-draft' !== $redirect_post->post_status ) {
                $redirect_url = get_permalink( $redirect_post );
                


    return $result;
}

/** * Corrects 404 redirects when NOBLOGREDIRECT is defined. * * @since MU (3.0.0) */
function maybe_redirect_404() {
    if ( is_main_site() && is_404() && defined( 'NOBLOGREDIRECT' ) ) {
        /** * Filters the redirect URL for 404s on the main site. * * The filter is only evaluated if the NOBLOGREDIRECT constant is defined. * * @since 3.0.0 * * @param string $no_blog_redirect The redirect URL defined in NOBLOGREDIRECT. */
        $destination = apply_filters( 'blog_redirect_404', NOBLOGREDIRECT );

        
if ( ! empty( $title ) ) {
        return $title;
    }

    global $page$paged;

    $title = array(
        'title' => '',
    );

    // If it's a 404 page, use a "Page not found" title.     if ( is_404() ) {
        $title['title'] = __( 'Page not found' );

        // If it's a search, use a dynamic search results title.     } elseif ( is_search() ) {
        /* translators: %s: Search query. */
        $title['title'] = sprintf( __( 'Search Results for &#8220;%s&#8221;' )get_search_query() );

        // If on the front page, use the site title.     } elseif ( is_front_page() ) {
        $title['title'] = get_bloginfo( 'name', 'display' );

        
<li> <?php get_search_form(); ?> </li> <!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it. <li><h2><?php _e( 'Author' ); ?></h2> <p>A little something about you, the author. Nothing lengthy, just an overview.</p> </li> --> <?php                 if ( is_404() || is_category() || is_day() || is_month() ||
                is_year() || is_search() || is_paged() ) :
                    ?> <li> <?php if ( is_404() ) : /* If this is a 404 page */ ?> <?php elseif ( is_category() ) : /* If this is a category archive */ ?> <p> <?php                     printf(
                        /* translators: %s: Category name. */
                        __( 'You are currently browsing the archives for the %s category.' ),
                        

        if ( false !== apply_filters( 'pre_handle_404', false, $wp_query ) ) {
            return;
        }

        // If we've already issued a 404, bail.         if ( is_404() ) {
            return;
        }

        $set_404 = true;

        // Never 404 for the admin, robots, or favicon.         if ( is_admin() || is_robots() || is_favicon() ) {
            $set_404 = false;

            // If posts were found, check for paged content.         } elseif ( $wp_query->posts ) {
            
Home | Imprint | This part of the site doesn't use cookies.