Podcast XML Using WordPress Query (2 posts)

  1. alanchrishughes
    Posted 2 years ago #

    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">
    <title>Website Title</title>
    <itunes:name>Website Name</itunes:name>
    <itunes:image href="" />
    <itunes:category text="Sports & Recreation">
    <itunes:category text="Am" />
    <?php if (have_posts()) : ?>
    <?php query_posts(array( 'post_type'=>'post', 'podcast'=>$term->yes)); ?>
    <?php while (have_posts()) : the_post(); ?>
    <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>
    <?php endwhile; ?>
    <?php else : endif; ?>
  2. alanchrishughes
    Posted 2 years ago #

    Is there a way to do it the other way around, XML inside a .php file?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.