wordpress 不渲染链接
我在我的 WordPress 副本中使用 标签来创建主要内容的摘录并回显链接,但是它完全忽略此标签并只是发布完整的文章,下面是希望我在我的模板中实现它,
我做错了什么吗?目前,当我使用上面的代码时,它显示 while post,但是我相信它应该只显示
标记上方的所有内容?
I am using the <!--more-->
tag in my wordpress copy to create an excerpt from the main content and also echo a link, however it is totally disregarding this tag and just posting the full article, below is hope I am implementing it in my templates,
<?php the_content("Read more about this article..."); ?>
am I doing something wrong? Currently it is showing the while post when I use the above code, however it is my belief that it should only only show everything above the <!--more-->
tag?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据官方 WordPress 支持网站:
通过使用 PHP代码,看起来您想在页面上使用
more
标签。更多
适用于博客文章,但不适用于页面。请将以下代码添加到您提供的 PHP 行之上的文档中,以使其正常工作:此外,请确保您不仅仅处于预览模式,并且您实际上已经发布了文章并预览了它:
As per the official WordPress support site:
From the use of your PHP code, it looks like you want to use the
more
tag on pages.More
works with blog posts but not pages. Please add the following code to your document above your PHP line you provided to make it work:Also, be sure that you are not simply in preview mode and that you have actually published the article and previewed it:
也许您正在使用自定义页面模板来显示档案。 “更多”标签在页面中不起作用。如果您想在 Pages 文稿中启用它...
Perhaps you are using custom page template to display archives. "More" tag doesn't work in pages. If you want to turn it on in Pages...
如果你想在页面中显示它,你应该使用这样的代码
you should use the code like this if you wanna show the to work in a page