wordpress静态
WordPress has two ways of showing excerpts in a blog. One is by using the_excerpt() tag in your themes, and the other method is by using the more tag. The more tag allows you to specify where the cut off point is in a post while writing a post which makes it easy for the editor and allow you to show teaser content and such. However the more tag is used only on the home page which shows the latest posts. It does not work in Pages. Recently we encountered this issue and thanks to the WordPress forums we found the solution. If you want to turn on the read more tags in pages for showing partial posts, use the following code inside the loop:
WordPress有两种在博客中显示摘录的方式。 一种是在主题中使用the_excerpt()标记 ,另一种方法是使用more标记。 更多标签可让您在撰写帖子时指定帖子中的截止点,这对于编辑器来说很容易,并允许您显示预告片内容等。 但是,更多标签仅在显示最新帖子的主页上使用。 在Pages中不起作用。 最近,我们遇到了这个问题,感谢WordPress论坛,我们找到了解决方案。 如果要打开页面上的阅读更多标签以显示部分帖子,请在循环内使用以下代码:
<?php
global $more;
$more = 0;
?>
//The code must be inserted ahead of the call to the content
<?php the_content('Continue Reading'); ?>
That’s it. If any of you theme designers ever get into this issue, then this should be a quick fix.
而已。 如果您有任何主题设计师曾经遇到过这个问题,那么这应该是一个快速修复。
翻译自: https://www.wpbeginner.com/wp-themes/fixing-the-read-more-tag-problem-in-wordpress-static-pages/
wordpress静态