WordPress 读取更多错误和长度
好吧,我确实找不到任何引用此问题的内容。我已经查明发生这种情况的原因,但找不到解决方案。因此,当作者发表帖子并且在作者页面中使用的标签不超过 40 个字且不包含“阅读更多”链接时,就会发生这种情况。因此,基本上,如果 more 标签未放置至少 40 个单词,则链接不会显示,并假设该帖子只有 5 个单词长。
这是问题的链接... http://www.dudnyk.com/blog/author/frank-powers
如果您查看下面的第二篇文章,您会发现没有“继续阅读”,但如果您在博客主页上查找该文章,您会看到有一个链接。如果我将阅读内容移到帖子的下方,它就会起作用。有什么想法吗?
循环从这里开始... get_template_part( 'loop', 'author' );但我不知道如何找到该函数在哪里做什么。
Ok so I literally can't find anything that references this issue. I've tracked down why it's happeneing but can't find a solution. So what's happening is when an author makes a post and the tag is used at a point that isnt 40 words in the author page doesnt include the read more link. So basically if the more tag isnt placed atleast 40 words in, the link doesnt show up and assumes the post is only that may words long.
here's a link to the issue...
http://www.dudnyk.com/blog/author/frank-powers
if you look at the 2nd post down you can see there is no "Continue Reading" but if you look for that post on the main blog page, you'll see there is a link for it. If I moved the read more further down in the post it would work. any ideas??
the loop is initiated here... get_template_part( 'loop', 'author' ); but i'm not sure how to find where that function is doing what where.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在使用 WordPress 主题“TwentyTen”(的子主题),该主题自 3.0 发布以来随 WordPress 一起提供。
您的functions.php中有两个函数共同导致您的见证效果。
将摘录长度设置为 40 个字。与此类似:
应该有第三个函数
twentyten_continue_reading_link()
,它应该由第二行中的twentyten_auto_excerpt_more( $more )
调用,如下所示:但不知怎的,它不起作用。要么是因为自动摘录功能没有调用继续阅读链接,要么是因为继续阅读链接不存在。
无论如何,如果您不在网站上的其他任何地方使用摘录,只需在我发布的第一个函数中将摘录长度设置为低于 40 的值 - 或者,如果您使用摘录,请修改第二个函数,使其返回“继续阅读” ...' 关联。
You are using (a child theme of) the wordpress theme 'TwentyTen', which ships with wordpress since 3.0 was released.
There are two functions in your functions.php that together cause the effect your witnessing.
sets the excerpt length to 40 words. And something along the lines of this:
There should be a third function,
twentyten_continue_reading_link()
, which should be called bytwentyten_auto_excerpt_more( $more )
in the second line like so:But somehow it doesn't work. Either because the auto excerpt function does not call the continue reading link, or because the continue reading link does not exist.
Anyway, if you do not use excerpts anywhere else on your site, just set the excerpt length to a lower value than 40 in the first function I posted - or, if your using excerpts, modify the second such that it returns a 'Continue reading...' link.