If you are into Podcasting then you’re familiar with RSS feeds featuring enclosures. This is a modification for wordpress that enables adding enclosures to your posts. These enclosures are then automatically added to the rss 2.0 feed.
Do you like this article? Submit it to Blogosphere News!
2 Responses
James E. Robinson, III
January 10th, 2005 at 9:13 am
1Using the custom fields yields a very simple way to add the necessary info to a post. Then a little bit of code in wp-rss2.php:
< ?php
if ( isset($post_meta_cache[$post->ID]['enclosure'][0]) &&
isset($post_meta_cache[$post->ID]['enclosure-file'][0]) ) {
$encVal = trim($post_meta_cache[$post->ID]['enclosure'][0]);
$encFile = trim($post_meta_cache[$post->ID]['enclosure-file'][0]);
$encLength = filesize($encFile);
$encType = “audio/mpeg”;
if ( isset($post_meta_cache[$post->ID]['enclosure-type'][0]) ) {
$encType = trim($post_meta_cache[$post->ID]['enclosure-type'][0]);
}
echo “\t” . ‘ ‘ . “\n”;
}
?>
James E. Robinson, III
January 10th, 2005 at 9:14 am
2well, that got munged, but you get the idea.