1、修正文章页面模板single.php
关上模版文件中的single.php,在其中搜寻
在这行上面加上:
<p>原创文章如转载,请注明本文链接: <a href=”<?php the_permalink() ?>” title=”<?php the_title(); ?>”>
<?php the_permalink(); ?></a>
</p>
2、关上主题文件夹内的:functions.php文件,在末尾退出代码(复制粘贴时请留意中英文标点):
<?php
function feed_copyright($content) {
if(is_single() or is_feed() or is_page()) {
$content.= ‘<p>本文来自:<a title=”博客” href=”https://www.jb51.net” target=”_blank”>小谈博客</a> » <a rel=”bookmark” title=”‘.get_the_title().’” href=”‘.get_permalink().’” target=”_blank”>《’.get_the_title().’》</a></p>’;
$content.= ‘<p>本文链接地址:<a rel=”bookmark” title=”‘.get_the_title().’” href=”‘.get_permalink().’” target=”_blank”>’.get_permalink().’</a> »英雄不问去路,转载请注明出处,谢谢。</p>’;
$content.= ‘<p>有话想说:<a title=”给我留言” href=”‘.get_permalink().’#respond” target=”_blank”>那就连忙去给我留言吧.</a></p>’;
$content.= ‘<p>您也能够订阅本站:<a rel=”external nofollow” title=”小谈博客” href=”https://www.jb51.net/” target=”_blank”>https://www.jb51.net</a></p>’;
}
return $content;
}
add_filter (‘the_content’, ‘feed_copyright’);
?>
以上就是安达网络工作室关于《在wordpress文章末尾添加内容的简单方法》的一些看法。更多内容请查看本栏目更多内容!
一、增加一个存储投稿者邮箱的自定义栏目 关上WordPress增加投稿性能,上面咱们将对这篇文章中的代码进...
明天偶尔发现了Dreamweaver的一个十分有用的性能,就是代码的格局化性能。普通状况下,咱们写的html或许css...
家喻户晓,WordPress中文版有个特性,会将每一处英文引号("")都稀里哗啦转化为中文引号(“”)...
讯问后果却有些出人意料,居然是超流量了,应用这么久还是第一次遇到超量的状况。 登陆cPanel后盾查看也的确...
wordpress完成随机文章 ralix曾公布过对于wordpress随机文章的相干插件的点评文章(“wordpress插件之...
WordPress 3.5 新增加了一个提醒框性能,能够创立一个提醒框,而后指向任何元素,比方下边的例子: 本文就...