Displaying Custom Fields & Custom Taxonomies in RSS Feeds?
-
I’m trying to display a custom field and a custom taxonomy in the RSS feeds.
I found the below code which dies what I want:
add_action('rss_item', 'rssCustomFieldContent'); add_action('rss2_item', 'rssCustomFieldContent'); function rssCustomFieldContent() { $thispostID = get_the_ID(); echo '<audio_link>' . get_post_meta($thispostID, 'wpcf-sermon_audio', true) . '</audio_link>'; $speaker = wp_get_post_terms($thispostID, 'teacher', array('fields' => 'names')); echo '<speaker>' . $speaker[0] . '</speaker>'; }
I’m probably an idiot but I can’t figure out where to put it. I tried my theme’s functions.php but that didn’t seem to work…
Where do I put this code? Or is there an alternative way to get the same result?
- The topic ‘Displaying Custom Fields & Custom Taxonomies in RSS Feeds?’ is closed to new replies.