【CMS体系建站】wordpress怎样自动在正文内容后增加内容
2019-11-17cms搜奇网72°c
A+ A-wordpress怎样自动在正文内容后增加内容
许多时刻,你都需要在文章内容背面增加一些信息,比方定阅,文章分享,珍藏和Creative Commons协定声明等。
要在文章尾部自动增加内容的话,只需要在主题的function.php里增加一下代码:
function insertFootNote($content) { if(!is_feed() && !is_home()) { $content.= "<div class='subscribe'>"; $content.= "<h4>Enjoyed this article?</h4>"; $content.= "<p>Subscribe to our <a href='http://feed.ki4.cn/'>RSS feed</a> and never miss a recipe!</p>"; $content.= "</div>"; } return $content; } add_filter ('the_content', 'insertFootNote');
以上例子的结果是在每篇文章的尾部自动增加定阅提醒。
引荐教程:WordPress教程
以上就是wordpress怎样自动在正文内容后增加内容的细致内容,更多请关注ki4.cn别的相干文章!