我的wordpress 3.5博客有一个恼人的问题。
the_content()函数不能在第一页/索引页上显示文章的简短版本,而是显示文章的完整内容。
我当前来自loop.php文件的the_content()代码行是:
<?php the_content('Read more...'); ?>我确实尝试过搜索wordpress论坛、stackoverflow和codex,并尝试了以下内容:
<?php
global $more; // Declare global $more (before the loop).
$more = 0; // Set (inside the loop) to display content above the more tag.
the_content("More...");
?>但它不起作用。
你知道这是什么问题吗?
发布于 2013-01-13 00:00:00
您是否在想要显示更多链接的页面内容中添加了<!--more-->标记?摘自the_excerpt()上的Codex
有时只使用
the_content()函数更有意义。the_content()将根据是否使用了<!--more-->标签来决定显示什么内容。<!--more-->标记将post/页面分成两部分:清单中只显示标记之前的内容。请记住,当显示单个帖子/页面时,<!--more-->(当然)被忽略。
https://stackoverflow.com/questions/14294049
复制相似问题