WordPress.org

Support

Support » How-To and Troubleshooting » Podcast XML Using WordPress Query

Podcast XML Using WordPress Query

  • I know podpress is an easy to use plugin, but its also huge and I just wanted to just create a taxonomy (yes or no) and write one little podcast xml file to query posts checked as “yes”. Then a custom field to grab the file’s url of the podcast.

    I’m a designer so it wasn’t immediately obvious to me that using php inside an XML file wouldn’t work. Is there anyway this or something simple and similar to this would be possible? This is what I was gonna do.

    <?xml version="1.0" encoding="UTF-8"?>
    
    <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
    
    <channel>
    <title>Website Title</title>
    <link>http://www.website.com</link>
    <language>en-us</language>
    <copyright>Blah</copyright>
    <itunes:subtitle>Subtitle</itunes:subtitle>
    <itunes:author>Author</itunes:author>
    <itunes:summary>Summary</itunes:summary>
    <description>description</description>
    <itunes:owner>
    <itunes:name>Website Name</itunes:name>
    <itunes:email>email@email.com</itunes:email>
    </itunes:owner>
    <itunes:image href="" />
    <itunes:category text="Sports & Recreation">
    <itunes:category text="Am" />
    </itunes:category>
    
    <?php if (have_posts()) : ?>
    
    <?php query_posts(array( 'post_type'=>'post', 'podcast'=>$term->yes)); ?>
    
    <?php while (have_posts()) : the_post(); ?>
    
    <item>
    
    <title><?php the_title(); ?></title>
    
    <itunes:author>ONE Blade Mag</itunes:author>
    
    <itunes:subtitle><?php wpe_excerpt(''); ?></itunes:subtitle>
    
    <itunes:summary><?php wpe_excerpt(''); ?></itunes:summary>
    
    <enclosure url="<?php echo $podcasturl; ?>"/>
    
    <pubDate><?php the_time() ?></pubDate>
    
    </item>
    
    <?php endwhile; ?>
    <?php else : endif; ?>
    
    </channel>
    </rss>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Podcast XML Using WordPress Query’ is closed to new replies.