【问题标题】:Wordpress Custom Post Type "Read More" problemWordpress 自定义帖子类型“阅读更多”问题
【发布时间】:2011-05-21 07:57:53
【问题描述】:

我创建了一个使用this tutorial 制作的自定义帖子类型。问题是当我尝试显示帖子的一部分时,它的工作方式完全相反!

发布文字:

You should see me!
<!--more-->
Not me. At least not yet.

PHP 代码:

<?php the_content("Read more...",TRUE,''); ?>

应该显示如下内容:

“你应该看到我!

阅读更多..."

但它显示:

“不是我。至少现在还没有。”

而且没有“阅读更多...”链接。

发生了什么事?

【问题讨论】:

  • 你最好在wordpress.stackexchange.com问这个问题,顺便说一句。
  • 我同意...或在 wordpress.org 论坛上。但是,我们也许可以在这里提供帮助。你能发布你的整个循环吗?尝试重置$more 类似于&lt;?php query_posts('showposts=5'); global $more; $more = 0; if (have_posts()) : ?&gt; 另外,尝试the_content() 不包含其他内容,例如the_content('Read more...');

标签: wordpress


【解决方案1】:

我也遇到了同样的问题。经过详细观察,我发现阅读更多标签不适用于模板标签。看这里

https://developer.wordpress.org/reference/functions/the_content/

在只显示一篇文章的模板中,例如single.php,快速标签将不起作用并被忽略。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-27
    • 1970-01-01
    • 1970-01-01
    • 2011-11-21
    相关资源
    最近更新 更多