2013-01-25 183 views
0

如何添加帖子的标签列表到wordpress rss feed?我已经修改了我的feed-rss.php来导出作者和发布日期,但是我找不到在rss中插入的函数,甚至导出每个帖子的标签列表。将标签列表添加到wordpress rss

<?php 
/** 
* RSS 0.92 Feed Template for displaying RSS 0.92 Posts feed. 
* 
* @package WordPress 
*/ 

header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' .  get_option('blog_charset'), true); 
$more = 1; 

echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> 
<rss version="0.92"> 
<channel> 
    <title><?php bloginfo_rss('name'); wp_title_rss(); ?></title> 
    <link><?php bloginfo_rss('url') ?></link> 
    <description><?php bloginfo_rss('description') ?></description> 
    <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000',  get_lastpostmodified('GMT'), false); ?></lastBuildDate> 
    <docs>http://backend.userland.com/rss092</docs> 
    <language><?php echo get_option('rss_language'); ?></language> 
    <?php do_action('rss_head'); ?> 

<?php while (have_posts()) : the_post(); ?> 
<item> 
    <dc:creator><?php the_author() ?></dc:creator> 
    <title><?php the_title_rss() ?></title> 
    <description><![CDATA[<?php the_excerpt_rss() ?>]]></description> 
    <link><?php the_permalink_rss() ?></link> 
    <?php do_action('rss_item'); ?> 
    <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate> 
    <tags><?php echo the_tags(); ?></tags> 
</item> 
<?php endwhile; ?> 
</channel> 
</rss> 

回答

0

我不认为在RSS中有一个函数来获取标签,因为所有的标签都显示为类别。

尝试使用wp_get_post_tags方法加载标签并将它们添加到标签中。