51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

wordpress 给每篇文章底部添加内容插

进入WordPress的后台,点击 "外观"》"编辑",在右边栏"模板",点击"Theme Functions (functions.php)",进入functions.php的编辑界面。

我们要把这段代码复制到WordPress的functions.php中,

//在所有文章底部添加自定义内容
function add_after_post_content($content) {
if(!is_feed() && !is_home() && is_singular() && is_main_query()) {
$content .= '你需要添加的自定义内容';
}
return $content;
}
add_filter('the_content', 'add_after_post_content');

赞(0)
未经允许不得转载:工具盒子 » wordpress 给每篇文章底部添加内容插