【问题标题】:Wordpress - Adding editor content to a page with a templateWordpress - 使用模板将编辑器内容添加到页面
【发布时间】:2014-10-31 16:37:42
【问题描述】:

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

您当然应该能够在某处启用此功能?如何做到这一点,或者它因主题而异?

【问题讨论】:

    标签: wordpress themes editor wysiwyg


    【解决方案1】:

    在页面模板中添加循环和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;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-02
      • 2014-12-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多