php技术博客
让天下没有搞不定的bug~

wordpress提交文章后添加固定字符或者固定连接

wordpress提交文章后添加固定字符或者固定连接代码如下:

function insertFootNote($content) {
$content.= ‘<font style=”color: red; font-weight: bold; border: 1px solid rgb(204, 204, 204); padding: 5px; margin-left: 203px; margin-bottom: 60px;”><a href=”https://zoneself.vip/” target=”_blank”>技术分享,技术交流,小涛与您共同成长</a></font>’;
return $content;
}
add_filter (‘the_content’, ‘insertFootNote’);

方法可以自定义,吧这段代码放到自己主题的functions.php中就可以实现了,就是在发布文章的时候自动加入追加的$content连接的字符串,以前我写文章的时候都是自己手动复制连接,现在不用啦,可以智能插入了,省下不少时间,呵呵……赶快来试试吧!

赞(0)
未经允许不得转载:PHP技术博客 » wordpress提交文章后添加固定字符或者固定连接