2013-01-25 180 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方法加載標籤並將它們添加到標籤中。