Wordpress - 页面内容无法显示

use*_*023 -1 php wordpress

我使用以下说明使用bootstrap 3创建了一个Wordpress主题:

http://www.creativewebdesign.ro/en/blog/wordpress/create-a-responsive-wordpress-theme-with-bootstrap-3-header-and-footer/

内容未显示在任何页面上.我不确定容器div是否有问题:

http://www.dawaf.co.uk/creative-mapping/

当我查看页面源时,测试文本不会显示.

的index.php

<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme and one of the
 * two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * For example, it puts together the home page when no home.php file exists.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Wp_Bootstrap
 * @since Wp Bootstrap 1.0
 */

    // Gets header.php
    get_header();

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<?php the_title(); ?></h1>  
        <div class="entry">
            <?php the_content(); ?>
        </div><!-- entry -->
<?php endwhile; ?>
<?php endif; ?>

    // Gets footer.php
    get_footer(); 
?>
Run Code Online (Sandbox Code Playgroud)

page.php文件

<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme and one of the
 * two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * For example, it puts together the home page when no home.php file exists.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Wp_Bootstrap
 * @since Wp Bootstrap 1.0
 */

    // Gets header.php
    get_header();

    // Gets footer.php
    get_footer(); 
?>
Run Code Online (Sandbox Code Playgroud)

Rom*_*man 13

<?php the_content(); ?>在你的代码中看不到.这是显示内容所必需的.在这里,您可以看到有关the_contentWordpress页面.因此,请添加<?php the_content(); ?>到您index.phppage.php文件中,或添加到您的文件中,或者添加到您要显示内容的位置.

编辑:

您还可以查看wordpress文件夹中的其他主题(二十几岁等).在那里你可以看到如何<?php the_content(); ?>使用.

编辑2:

我忘了说这个.您还必须将此添加到您的文件中:

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<?php the_title(); ?></h1>  
        <div class="entry">
            <?php the_content(); ?>
        </div><!-- entry -->
<?php endwhile; ?>
<?php endif; ?>
Run Code Online (Sandbox Code Playgroud)

这将检查您是否有任何帖子或页面.如果是,它将显示它,如果不是,它将不显示任何内容.把它放在你和你index.php之间.<?php get_header(); ?><?php get_footer(); ?>

编辑3:

我在你的问题中看过你的编辑.我已经看到了这个错误.你打开了<?php两次标签.你可以这样:

<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme and one of the
 * two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * For example, it puts together the home page when no home.php file exists.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Wp_Bootstrap
 * @since Wp Bootstrap 1.0
 */

    // Gets header.php
    get_header();
?>

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<?php the_title(); ?></h1>  
        <div class="entry">
            <?php the_content(); ?>
        </div><!-- entry -->
<?php endwhile; ?>
<?php endif; ?>

<?php // Gets footer.php
get_footer(); 
?>
Run Code Online (Sandbox Code Playgroud)

这段代码应该在你的index.php和你的page.php.