怎样实现在wordpress中添加转载文章的源链接?

<ul class="post_metadata">
<li>作者:<?php the_author(); ?> </li>
<li>日期:<?php the_time('Y-m-d'); ?> </li>
<li>分类:<?php the_category(', ') ?> </li>
<li>标签:<?php the_tags('', ', ', ''); ?></li>
<li>转载自:<????????????????????????></li>
</ul>

如上:我们都会有转载别人文章的时候,我想在标签后面加上一个“转载自:”项目,请问这个要怎么实现,什么代码?需要什么插件?

第1个回答  2011-05-18
对于WordPress程序来说,只需编辑themes下的模板文件single.php,在适当的位置加入以下代码即可。

<p>原创文章,转载请注明:<strong><a href=”<?php bloginfo(‘url’); ?>”><?php bloginfo(‘name’); ?></a></strong>[<a href="<?php echo get_settings('home'); ?>"><?php echo get_settings('home'); ?></a>]</br>
本文链接地址: <a href=”<?php the_permalink() ?>” title=”<?php the_title(); ?>”><?php the_permalink(); ?></a></p>追问

我不是说别人转载我的,我是转载别人的。达到下面这个效果:

————————————————————————————————————————
作者:XXXX(我自己)日期:XX-XX-XX 分类:XXXX 标签:XXXX 转载自:XXXX(就是这个连接)
————————————————————————————————————————

第2个回答  2011-05-18
这种功能建议查找一款插件来实现,代码实现的话很繁琐追问

插件没找到,另为你说的这个也可以用插件实现:Add Post URL,管理起来比较方便。

已经搞定了~,可以用自定义字段来完成~ 仍然感谢~ 分给你吧

本回答被提问者采纳
相似回答