我使用本教程创建了自己的自定义帖子类型:http://thinkvitamin.com/code/create-your-first-wordpress-custom-post-type/
一切都很好,但我对“阅读更多”功能有很大的问题。
我们都知道<!--more-->
添加<span id="more-[number]" />
在隐藏更多段落的开头。在我的例子中,这个跨度破坏了整个标记。
你自己看看:
<p>This is normal paragraph and should be visible everywhere.</p>
<!-- everything below is available only after clicking "Read more..." button -->
<p><span id="more-[postnumber] />This is read "more" paragraph that will be displayed only on a "single" page.</p>
<p>And another "more" paragraph.</p>
在我的例子中,它创建了以下奇怪的代码:
<p>This is normal paragraph and should be visible everywhere.<br/>
<span id="more-[postnumber] /></br>This is read "more" paragraph that will be displayed only on a "single" page.</p>
<p>And another "more" paragraph.</p>
因此,我的“更多”功能甚至不起作用,甚至不显示“阅读更多”按钮。
有什么想法吗?
[已编辑]
好的,我在<!--more-->
标记,因此帖子现在在管理面板中如下所示:
This is normal paragraph and should be visible everywhere.
<!--more-->
This is read "more" paragraph that will be displayed only on a "single" page.
And another "more" paragraph.
它输出整个文本,因为跨度越大,就会得到一个额外的段落(为什么?:O):
<p>This is normal paragraph and should be visible everywhere.</p>
<p><span id="more-[postnumber] /></p> <!-- I believe it shouldn\'t be in the additional <p> tag and that\'s the point -->
<p>This is read "more" paragraph that will be displayed only on a "single" page.</p>
<p>And another "more" paragraph.</p>
关于“更多按钮”-不幸的是,我正在使用\\u内容。。。
当我键入“TRUE”作为第二个参数时,没有任何帮助-内容(\'Read more…\',TRUE);-它在more标记之前隐藏所有内容(因此它显示最后两段,并隐藏第一段)。
那是什么?:O