I'm trying to figure out how to get custom fields into an RSS feed. I've created a new custom field key called "colour" and I want to have the value in my feed as well as the usual title and description, eg:
<item>
<title>Banana</title>
<description>A long fruit that you peel.</description>
<colour>Yellow</colour>
</item>
I've looked in Codex here:
http://codex.wordpress.org/Custom_Fields
But I can't figure it out. I've tried adding a line to the loop for colour to the RSS php file, but it doesn't work:
<?php while (have_posts()) : the_post(); ?>
<item>
<title><?php the_title_rss() ?></title>
<description><?php the_excerpt_rss() ?></description>
<colour><?php get_post_meta($post->ID, $key, $single) ?></colour>
<?php do_action('rss_item'); ?>
</item>
<?php endwhile; ?>
Hopefully I'm missing something simple, any help much appreciated!