Title: Podcast XML Using WordPress Query
Last modified: August 20, 2016

---

# Podcast XML Using WordPress Query

 *  [alanchrishughes](https://wordpress.org/support/users/alanchrishughes/)
 * (@alanchrishughes)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/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)

 *  Thread Starter [alanchrishughes](https://wordpress.org/support/users/alanchrishughes/)
 * (@alanchrishughes)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/podcast-xml-using-wordpress-query/#post-3315508)
 * Is there a way to do it the other way around, XML inside a .php file?

Viewing 1 replies (of 1 total)

The topic ‘Podcast XML Using WordPress Query’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [alanchrishughes](https://wordpress.org/support/users/alanchrishughes/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/podcast-xml-using-wordpress-query/#post-3315508)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
