通过<!–more–>可以让文章在首页或列表页显示文章截段并生成“Read more..”或“阅读全文”的链接,之前在浏览网页的时候看到WordPress博客教程中的<!–more–>标签的链接对博客SEO的影响,即链接重要,不利于搜索引擎优化,所以很多WordPress博客用户纷纷对<!–more–>添加nofollow。
添加nofollow的方法步骤:
1 2 3 4 | add_filter('the_content_more_link','nofollowReadMore' ,0); function nofollowReadMore($link) { return str_replace('class="more-link"', 'class="more-link" rel="nofollow"', $link); } |
提醒:代码非博客吧原创!!