Performancing Metrics

Enclosures In WordPress RSS Feed

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.

Categories: WordPress Hacks

This post was written by . You can visit the for a short bio, more posts, and other information about the author.

Get backlinks to your Blog!

Promote Your Blog

If you are looking to promote your blog and get high quality backlinks from a PR6 2003 domain then Blogsearchengine.com is for you. For as little as $14.99 you can submit your blog and have a review written and published there with a backlink to your website or blog, we accept all niche!


Comments Closed

Comments

  1. James E. Robinson, III says: 1/10/2005

    Using 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";
    }
    ?>

  2. James E. Robinson, III says: 1/10/2005

    well, that got munged, but you get the idea.