Goal:
在单篇文章页面下方添加分页。Code
function add_pagin( $content ) {
if ( is_singular(\'post\') ) {
$content .= previous_post_link() . next_post_link();
}
return $content;
}
add_filter( \'the_content\', \'add_pagin\' );
Result
分页已添加到的顶部the_content
, 不低于它。如果我改变$content.=
要回显一个简单的字符串,它可以工作,但不能使用这两个wprdpress函数。我感谢你的帮助。