显示主页,但在标题处显示page NOT FOUND


Showing home page but at the title it shows PAGE NOT FOUND

  1. 我开发了一个wordpress主题。主页和关于我们有两个页面。主页我使用index.php,关于我们的页面我使用page.php模板。但当我点击主页时,它显示的标题是"找不到页面"。

  2. 我创建了一个名为HOME的页面,然后它显示我在主页上发布的页面内容,但我需要显示index.php的内容

这是网站admission247.com

我的页面php代码

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="page_content">
<?php // echo '<br/><br/>'; ?>
<?php the_content(); ?>
</div>
<?php endwhile; ?>
<?php endif; ?>

不看代码很难判断。

以下是我用于标头的代码片段。

<title><?php
    global $page, $paged;
    wp_title("&laquo;", true, "right");
    bloginfo("name");
    $site_description = get_bloginfo("description", "display");
    if($site_description && (is_home() || is_front_page()))
        echo " &laquo; $site_description";
    if($paged >= 2 || $page >= 2)
    echo " &laquo; " . sprintf(__("Page %s", "h18"), max($paged, $page));
?></title>

如果可以的话,尽可能多地发布代码。这将帮助其他人更好地理解你的问题。

YOUR_try this

functions.php

    function site_wp_title( $title, $sep ) {
    global $paged, $page;
    if ( is_feed() )
        return $title;
    // Add the site name.
    $title .= get_bloginfo( 'name' );
    // Add the site description for the home/front page.
    $site_description = get_bloginfo( 'description', 'display' );
    if ( $site_description && ( is_home() || is_front_page() ) )
        $title = "$title $sep $site_description";
    // Add a page number if necessary.
    if ( $paged >= 2 || $page >= 2 )
        $title = "$title $sep " . sprintf( __( 'Page %s', 'YOUR_SITE' ), max( $paged, $page ) );
    return $title;
}
add_filter( 'wp_title', 'site_wp_title', 10, 2 );

header.php

<title><?php wp_title( '|', true, 'right' ); ?></title>