### [wordpress怎么自动在正文内容后添加内容](https://www.prosaas.cn/article/9595) **Published:** 2019-11-16T03:59:54 **Author:** 5201314 **Excerpt:** wordpress怎么自动在正文内容后添加内容 很多时候,你都需要在文章内容后面添加一些信息,例如订阅,文章分… **![](//zhiqipro.oss-cn-beijing.aliyuncs.com/2023/12/20231212132538253.jpg)** **wordpress怎么自动在正文内容后添加内容**     很多时候,你都需要在文章内容后面添加一些信息,例如订阅,文章分享,收藏和Creative Commons协议声明等。  要在文章尾部自动添加内容的话,只需要在主题的function.php里添加一下代码:  function insertFootNote($content) { if(!is\_feed() && !is\_home()) { $content.= "
"; $content.= "

Enjoyed this article?

"; $content.= "

Subscribe to our RSS feed and never miss a recipe!

"; $content.= "
"; } return $content; } add\_filter ('the\_content', 'insertFootNote'); 以上例子的效果是在每篇文章的尾部自动添加订阅提示。 推荐教程:WordPress教程  以上就是wordpress怎么自动在正文内容后添加内容的详细内容,更多请关注知企PROSAAS其它相关文章! **Tags:** function, php, WordPress **Categories:** WordPress ---