我有一个奇怪的情况发生在我目前正在开发的网站上。在主页上的http://wptest.lancscps.co.uk/articles/ 当用户单击“继续阅读”链接以基于single-article.php
, 我们在这一页上写了一半,这不是我们想要的效果。我更希望用户像人们所期望的那样被带到页面的顶部。
这是否发生在其他人身上,是否有已知的原因?
我有一个奇怪的情况发生在我目前正在开发的网站上。在主页上的http://wptest.lancscps.co.uk/articles/ 当用户单击“继续阅读”链接以基于single-article.php
, 我们在这一页上写了一半,这不是我们想要的效果。我更希望用户像人们所期望的那样被带到页面的顶部。
这是否发生在其他人身上,是否有已知的原因?
您正在使用more
标记将文章分为摘要和其余内容。“更多”链接假设读者已经完成了前者,并尝试在整篇文章中将浏览器导航到这一点。
Codex已修改了中记录的此行为Customizing the Read More > Prevent Page Scroll When Clicking the More Link 并建议以下代码:
function remove_more_link_scroll( $link ) {
$link = preg_replace( \'|#more-[0-9]+|\', \'\', $link );
return $link;
}
add_filter( \'the_content_more_link\', \'remove_more_link_scroll\' );
我正在尝试编辑archive.php 这样,当我访问分类页面时,它只显示文章摘要,并使用特色图像作为缩略图。当我添加the_excerpt() 对于循环,它会显示第一篇文章的摘录,但只是无限期地重复它?以下是我试图编辑/修改的循环:// Start the Loop while (have_posts()) { the_excerpt(); get_template_part(\'content\', get_post_forma