Wordpress - 使用模板将编辑器内容添加到页面

时间:2014-10-31 16:37:43

标签: wordpress themes editor wysiwyg

在大多数Wordpress主题中,他们使用可以为页面选择的Wordpress模板。现在,在这个特定主题中,当您为页面选择模板时,它会丢弃您在编辑器部分中添加的内容。

当然你应该可以在某处启用它吗?如何做到这一点,或者主题与主题有什么不同?

1 个答案:

答案 0 :(得分:0)

在页面模板中添加循环和the_content()模板标记。查看主题文件夹中的page.php模板,了解主题所需的确切标记:

    // Start the Loop.
    while ( have_posts() ) : the_post();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <?php the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header>' ); ?>
    <div class="entry-content">
    <?php
        the_content();
        wp_link_pages();
    ?>
    </div><!-- .entry-content -->
</article><!-- #post-## -->
<?php
    endwhile;