欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

在wordpress文章末尾添加內(nèi)容的簡單方法

  發(fā)布時間:2013-11-13 15:55:50   作者:佚名   我要評論
如何在wordpress的文章末尾添加內(nèi)容,在wordpress每篇文章的末尾添加文字、鏈接等內(nèi)容,比如你想加個“原創(chuàng)文章如轉(zhuǎn)載,請注明本文鏈接:”,其實很簡單,有多種方法,下面就介紹給大家

1、修改文章頁面模板single.php
打開模版文件中的single.php,在其中搜索
在這行下面加上:

復制代碼
代碼如下:

<p>原創(chuàng)文章如轉(zhuǎn)載,請注明本文鏈接: <a href=”<?php the_permalink() ?>” title=”<?php the_title(); ?>”>
<?php the_permalink(); ?></a>
</p>

就OK了,還有一種方法:

2、打開主題文件夾內(nèi)的:functions.php文件,在末尾加入代碼(復制粘貼時請注意中英文標點):

復制代碼
代碼如下:

<?php
function feed_copyright($content) {
if(is_single() or is_feed() or is_page()) {
$content.= ‘<div>本文來自:<a title=”博客” href=”http://www.dbjr.com.cn” target=”_blank”>小談博客</a> &raquo; <a rel=”bookmark” title=”‘.get_the_title().’” href=”‘.get_permalink().’” target=”_blank”>《’.get_the_title().’》</a></div>’;
$content.= ‘<div>本文鏈接地址:<a rel=”bookmark” title=”‘.get_the_title().’” href=”‘.get_permalink().’” target=”_blank”>’.get_permalink().’</a> &raquo;英雄不問來路,轉(zhuǎn)載請注明出處,謝謝。</div>’;
$content.= ‘<div>有話想說:<a title=”給我留言” href=”‘.get_permalink().’#respond” target=”_blank”>那就趕緊去給我留言吧.</a></div>’;
$content.= ‘<div>您也可以訂閱本站:<a rel=”external nofollow” title=”小談博客” href=”http://www.dbjr.com.cn/” target=”_blank”>http://www.dbjr.com.cn</a></div>’;
}
return $content;
}
add_filter (‘the_content’, ‘feed_copyright’);
?>

推薦此法,不止可以在博客日志頁加入鏈接,包括feed里也可以,實現(xiàn)以后的效果如本文下面顯示,藍色文字部分請根據(jù)自己的博客修改。

相關文章

最新評論