is_page example

// Extract updated query vars back into global namespace.         foreach ( (array) $wp_query->query_vars as $key => $value ) {
            $GLOBALS[ $key ] = $value;
        }

        $GLOBALS['query_string'] = $this->query_string;
        $GLOBALS['posts']        = & $wp_query->posts;
        $GLOBALS['post']         = isset( $wp_query->post ) ? $wp_query->post : null;
        $GLOBALS['request']      = $wp_query->request;

        if ( $wp_query->is_single() || $wp_query->is_page() ) {
            $GLOBALS['more']   = 1;
            $GLOBALS['single'] = 1;
        }

        if ( $wp_query->is_author() ) {
            $GLOBALS['authordata'] = get_userdata( get_queried_object_id() );
        }
    }

    /** * Set up the current user. * * @since 2.0.0 */
if ( $redirect_url ) {
                $redirect['query'] = remove_query_arg( array( 'p', 'post_type' )$redirect['query'] );
            }
        } elseif ( is_single() && ! empty( $_GET['name'] ) && ! $redirect_url ) {
            $redirect_url = get_permalink( $wp_query->get_queried_object_id() );
            $redirect_obj = get_post( $wp_query->get_queried_object_id() );

            if ( $redirect_url ) {
                $redirect['query'] = remove_query_arg( 'name', $redirect['query'] );
            }
        } elseif ( is_page() && ! empty( $_GET['page_id'] ) && ! $redirect_url ) {
            $redirect_url = get_permalink( get_query_var( 'page_id' ) );
            $redirect_obj = get_post( get_query_var( 'page_id' ) );

            if ( $redirect_url ) {
                $redirect['query'] = remove_query_arg( 'page_id', $redirect['query'] );
            }
        } elseif ( is_page() && ! is_feed() && ! $redirect_url
            && 'page' === get_option( 'show_on_front' ) && get_queried_object_id() === (int) get_option( 'page_on_front' )
        ) {
            $redirect_url = home_url( '/' );
        } elseif ( is_home() && ! empty( $_GET['page_id'] ) && ! $redirect_url
            
$m        = get_query_var( 'm' );
    $year     = get_query_var( 'year' );
    $monthnum = get_query_var( 'monthnum' );
    $day      = get_query_var( 'day' );
    $search   = get_query_var( 's' );
    $title    = '';

    $t_sep = '%WP_TITLE_SEP%'; // Temporary separator, for accurate flipping, if necessary.
    // If there is a post.     if ( is_single() || ( is_home() && ! is_front_page() ) || ( is_page() && ! is_front_page() ) ) {
        $title = single_post_title( '', false );
    }

    // If there's a post type archive.     if ( is_post_type_archive() ) {
        $post_type = get_query_var( 'post_type' );
        if ( is_array( $post_type ) ) {
            $post_type = reset( $post_type );
        }
        $post_type_object = get_post_type_object( $post_type );
        if ( ! $post_type_object->has_archive ) {
            

function comments_template( $file = '/comments.php', $separate_comments = false ) {
    global $wp_query$withcomments$post$wpdb$id$comment$user_login$user_identity$overridden_cpage;

    if ( ! ( is_single() || is_page() || $withcomments ) || empty( $post ) ) {
        return;
    }

    if ( empty( $file ) ) {
        $file = '/comments.php';
    }

    $req = get_option( 'require_name_email' );

    /* * Comment author information fetched from the comment cookies. */
<?php                 wp_list_categories(
                    array(
                        'show_count' => 1,
                        'title_li'   => '<h2>' . __( 'Categories' ) . '</h2>',
                    )
                );
                ?> </ul> <ul> <?php if ( is_home() || is_page() ) { /* If this is the frontpage */ ?> <?php wp_list_bookmarks(); ?> <li><h2><?php _e( 'Meta' ); ?></h2> <ul> <?php wp_register(); ?> <li><?php wp_loginout(); ?></li> <?php wp_meta(); ?> </ul> </li> <?php } ?>

function is_page( $page = '' ) {
    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_page( $page );
}

/** * Determines whether the query is for a paged result and not for the first page. * * 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 a paged result. */
$classes[] = 'single-format-standard';
                    }
                }
            }
        }

        if ( is_attachment() ) {
            $mime_type   = get_post_mime_type( $post_id );
            $mime_prefix = array( 'application/', 'image/', 'text/', 'audio/', 'video/', 'music/' );
            $classes[]   = 'attachmentid-' . $post_id;
            $classes[]   = 'attachment-' . str_replace( $mime_prefix, '', $mime_type );
        } elseif ( is_page() ) {
            $classes[] = 'page';

            $page_id = $wp_query->get_queried_object_id();

            $post = get_post( $page_id );

            $classes[] = 'page-id-' . $page_id;

            if ( get_pages(
                array(
                    'parent' => $page_id,
                    
if ( function_exists( 'mb_convert_encoding' ) ) {
    $title     = mb_convert_encoding( $titleget_option( 'blog_charset' )$charset );
    $excerpt   = mb_convert_encoding( $excerptget_option( 'blog_charset' )$charset );
    $blog_name = mb_convert_encoding( $blog_nameget_option( 'blog_charset' )$charset );
}

// Escape values to use in the trackback. $title     = wp_slash( $title );
$excerpt   = wp_slash( $excerpt );
$blog_name = wp_slash( $blog_name );

if ( is_single() || is_page() ) {
    $post_id = $posts[0]->ID;
}

if ( ! isset( $post_id ) || ! (int) $post_id ) {
    trackback_response( 1, __( 'I really need an ID for this to work.' ) );
}

if ( empty( $title ) && empty( $trackback_url ) && empty( $blog_name ) ) {
    // If it doesn't look like a trackback at all.     wp_redirect( get_permalink( $post_id ) );
    exit;
}

    public function is_front_page() {
        // Most likely case.         if ( 'posts' === get_option( 'show_on_front' ) && $this->is_home() ) {
            return true;
        } elseif ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' )
            && $this->is_page( get_option( 'page_on_front' ) )
        ) {
            return true;
        } else {
            return false;
        }
    }

    /** * Determines whether the query is for the blog homepage. * * This is the page which shows the time based blog content of your site. * * Depends on the site's "Front page displays" Reading Settings 'show_on_front' and 'page_for_posts'. * * If you set a static page for the front page of your site, this function will return * true only on the page you set as the "Posts page". * * @since 3.1.0 * * @see WP_Query::is_front_page() * * @return bool Whether the query is for the blog homepage. */
Home | Imprint | This part of the site doesn't use cookies.