wordpress怎么自动在正文内容后添加内容

   2025-07-24 admin00110

wordpress怎么自动在正文内容后添加内容   

很多时候,你都需要在文章内容后面添加一些信息,例如订阅,文章分享,收藏和CreativeCommons协议声明等。 

要在文章尾部自动添加内容的话,只需要在主题的function.php里添加一下代码: 

functioninsertFootNote($content){if(!is_feed()&&!is_home()){$content.="<divclass='subscribe'>";$content.="<h4>Enjoyedthisarticle?</h4>";$content.="<p>Subscribetoour<ahref='http://feed.php.cn/'>RSSfeed</a>andnevermissarecipe!</p>";$content.="</div>";}return$content;}add_filter('the_content','insertFootNote');
 
举报收藏 0打赏 0评论 0
 
更多>同类资讯
推荐图文
推荐资讯
点击排行
网站首页  |  关于我们  |  联系方式  |  用户协议  |  隐私政策  |  版权声明  |  网站地图  |  RSS订阅
Powered By DESTOON