在wordpress文章末尾增加内容的简略办法

1、修正文章页面模板single.php
关上模版文件中的single.php,在其中搜寻
在这行上面加上:


<p>原创文章如转载,请注明本文链接: <a href=”<?php the_permalink() ?>” title=”<?php the_title(); ?>”>
<?php the_permalink(); ?></a>
</p>

就OK了,还有一种办法:

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> &raquo; <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> &raquo;英雄不问去路,转载请注明出处,谢谢。</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’);
?>

推荐此法,不止能够在博客日志页退出链接,包括feed里也能够,完成当前的成果如本文上面显示,蓝色文字局部请依据本人的博客修正。

以上就是安达网络工作室关于《在wordpress文章末尾添加内容的简单方法》的一些看法。更多内容请查看本栏目更多内容!

本文相关话题: wordpress WordPress
版权声明:本文为 安达网络工作室 转载文章,如有侵权请联系我们及时删除。
相关文章
WordPress开发中的get_post_custom()函数应用解析

同get_post_meta()一样,用于前往文章的自定义字段值得一个函数,只不过get_post_custom()函数应用起来更简...

WordPress 2.8的8个特征的新增性能

最新版本的WordPress 2.8的公布,为WordPress网站开发者带来了更多的便当,让像WPYOU这样的基于WordPress的...

容许 WordPress 上传恣意文件的办法

此时假如上传一个不在预约义的平安扩大名列表,如.lrc,会报错: File type does not meet security guidel...

WordPress中非插件完成嵌套回复成果的办法

博客吧转载了零号相册的Wordpress博客自带嵌套回复教程。 自带嵌套性能工作原理: wordpress嵌套回复的工作...

WordPress 标签Tags页面制造办法

p.s.在搜寻引擎优化SEO上,百度仿佛对要害词TAGS更为偏爱 其实就是撰写一个新页面,它要使用一个名为tags.php...

Dreamweaver代码的格局化性能掌控html代码的格局

明天偶尔发现了Dreamweaver的一个十分有用的性能,就是代码的格局化性能。普通状况下,咱们写的html或许css...

需求提交

客服服务

亿鸽在线客服系统