Wordpress显示页面内容和循环?

Ste*_*eve 2 php wordpress wordpress-theming

我在页面模板中有一个自定义循环,通过类别和标记按类别显示帖子.它可以工作,但在循环之上,我需要显示页面本身的内容,即通常输入到Wordpress仪表板的内容.

我应该在模板中添加什么来显示此内容?

我试过了:

 $id = $post->ID;
 get_page($id);
 // then my custom loop
Run Code Online (Sandbox Code Playgroud)

哪个获取当前页面ID,但没有内容.

ReL*_*eaf 6

在WordPress中,调用

<?php the_content(); ?>
Run Code Online (Sandbox Code Playgroud)

只要它在循环内部,就会从使用该模板的页面上的WYSIWYG编辑器中提取内容.

最基本的例子可能如下所示:

<?php while (have_posts()) : the_post();/* Start loop */ ?>
        <?php the_content(); ?>
<?php endwhile; /* End loop */ ?>

<!-- Enter your custom loop for displaying posts by category down here -->
Run Code Online (Sandbox Code Playgroud)

更多信息:http://codex.wordpress.org/Function_Reference/the_content