我这样写在functions.php中的函数
function out() {
$s = 'End of the post, thanks for reading';
return $s;
}
add_filter('the_content','out');
而且我希望在文章内容之后,在帖子的末尾获取它。但它所做的只是未显示帖子条目(the_content输出的内容),而我仅收到“帖子结尾,谢谢阅读”。
我在做什么错?
尝试一下:
function out($content) {
return $content . ' End of the post, thanks for reading';
}
add_filter( 'the_content', 'out' );
您可以尝试这个吗?>
function out($content) {
$content .= '<br>End of the post, thanks for reading';
return $content;
}
add_filter('the_content','out');