当wordpress中的全文打开时,如何删除阅读更多?
代码看起来像这样,
function new_excerpt_length($length) {
return 100;
}
add_filter('excerpt_length', 'new_excerpt_length');
wp-admin>settings>reading>中有一个选项对于提要中的每篇文章,显示 如果设置为全文 excerpt() 必须返回完整长度的文章而不是指定的长度。
怎么办?
the code looks like this
function new_excerpt_length($length) {
return 100;
}
add_filter('excerpt_length', 'new_excerpt_length');
there is an option in wp-admin>settings>reading>For each article in a feed, show
if this is set to full text
the excerpt() must return full length article instead of specified length.
how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好问题!答案很简单:编写自己的函数!
在您最喜欢的编辑器中打开
functions.php
并按键盘上的随机按钮,直到得到如下所示的内容:现在,您已经准备好迎接最酷的部分了。一旦你进入循环,你可以写出一些像这样的魔法:
它会自动吐出一个摘录。它使用全局 post 变量和一切!您甚至可以在循环之外使用它:
并设置您自己的特殊长度!
或者也许你只是心里知道这不值得,你只是想展示整个事情。看起来怎么样?
在循环内,您必须为其提供一个帖子 ID,对此感到抱歉。
我希望这有帮助。祝你有美好的一天!
Good question! The answer is simple: write your own function!
Open up
functions.php
in your favorite editor and mash random buttons on your keyboard until you get something like this:Now, you're ready for the cool part. Once you're in your loop, you can write out some magic like this:
and it will automagically spit out an excerpt. It's using the global post variable and everything! You can even use it outside of the loop:
and set your own special length!
Or maybe you just know in your heart that it's not worth it, you just want to show the whole thing. How's that look?
Inside the loop, you're going to have to give it a post ID, sorry about that.
I hope this helps. Have a great day!