如何显示wordpress页面内容? [英] How do I display a wordpress page content?

查看:111
本文介绍了如何显示wordpress页面内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这非常简单,但由于某种原因,我只是没有找到我,而Google今天也没有帮助我。

I know this is really simple but it just isn't coming to me for some reason and google isn't helping me today.

我想输出网页内容,我该怎么做?

I want to output the pages content, how do I do that?

我以为是这样的:

I thought it was this:

<?php echo the_content(); ?>


推荐答案

@Marc B感谢您的评论。帮助我发现这一点:

@Marc B Thanks for the comment. Helped me discover this:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
the_content();
endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>

这篇关于如何显示wordpress页面内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆