wordpress怎么在文章底部加入链接地址
1、进入wordpress后台,点击“外观”-“编辑”
2、先打开functions.php文件,添加了一个自定义的函数chuangyizone_content(),内容为:function chuangyizone_content($more_link_text = null, $stripteaser = 0) {$content = get_the_content($more_link_text, $stripteaser);$content.= "转载请注明来自<a href='http://www.chuangyizone.com'>创益空间@沧海咏志</a>,";$content.= "本文地址:<a href='".get_permalink($post, true)."' title='".get_the_title($post_id)."'>".get_permalink($post, true)."</a>";$content.= "\n除非注明,创益空间文章均为原创,转载请注明出处和链接!";$content = apply_filters('the_content', $content);$content = str_replace(']]>', ']]>', $content);echo $content;}修改好之后点击“更新文件”按钮
3、在修改你文章模板的the_content()函数,将该函数名the_content()改为上面的chuangyizone_content()修改好之后点击“更新文件”按钮
4、至此修改完毕,该字段显示在文章结尾处,具体可参看我的网站 创益空间
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:91
阅读量:31
阅读量:94
阅读量:96
阅读量:58