whyisjake

Untitled

Aug 25th, 2011
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.10 KB | None | 0 0
  1. <?php
  2. /**
  3. * @package MakeZine
  4. * Template Name: iTunes RSS Feed
  5. */
  6. header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
  7. $more = 1;
  8. echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
  9. <rss version="2.0"
  10.     xmlns:content="http://purl.org/rss/1.0/modules/content/"
  11.     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  12.     xmlns:dc="http://purl.org/dc/elements/1.1/"
  13.     xmlns:atom="http://www.w3.org/2005/Atom"
  14.     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  15.     xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  16.     xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
  17.     <?php do_action('rss2_ns'); ?>
  18. >
  19. <channel>
  20.     <title>MAKE Magazine</title>
  21.     <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
  22.     <link><?php bloginfo_rss('url') ?></link>
  23.     <description><?php bloginfo_rss("description") ?></description>
  24.     <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
  25.     <language><?php echo get_option('rss_language'); ?></language>
  26.     <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
  27.     <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>
  28.     <image>
  29.       <title>MAKE Magazine</title>
  30.       <url>http://cdn.makezine.com/make/blogs/blog.makezine.com/images/make120x60.gif</url>
  31.       <link><?php bloginfo_rss('url') ?></link>
  32.     </image>
  33.     <itunes:author>O'Reilly Media, Inc.</itunes:author>
  34.     <itunes:subtitle>Technology on Your Time</itunes:subtitle>
  35.     <itunes:summary>Join MAKE magazine for a Weekend project each week you can build yourself! MAKE is a quarterly publication from O'Reilly for those who just can't stop tinkering, disassembling, re-creating, and inventing cool new uses for the technology in our lives. It's the first do-it-yourself magazine dedicated to the incorrigible and chronically incurable technology enthusiast in all of us. MAKE celebrates your right to tweak, hack, and bend technology any way you want. MAKE on iTunes is produced by Kip Kay and Phillip Torrone.</itunes:summary>
  36.     <itunes:owner>
  37.       <itunes:email>webmaster@makezine.com</itunes:email>
  38.     </itunes:owner>
  39.     <itunes:category text="Technology"></itunes:category>
  40.     <itunes:category text="Technology">
  41.       <itunes:category text="Gadgets" />
  42.     </itunes:category>
  43.     <itunes:category text="Science &amp; Medicine"></itunes:category>
  44.     <itunes:image href="http://cdn.makezine.com/make/blogs/blog.makezine.com/images/logos/rss_icon.jpg" />
  45.     <itunes:new-feed-url>http://blog.makezine.com/archive/category/make_podcast/feed</itunes:new-feed-url>
  46.     <itunes:explicit>no</itunes:explicit>
  47.     <docs>http://www.rssboard.org/rss-specification</docs> 
  48.     <?php do_action('rss2_head'); ?>
  49.     <?php
  50.         $args=array('post_type'=>'post', 'category_name'=>'make_podcast', 'showposts'=>45);
  51.         $qry=new WP_Query($args);
  52.         while( $qry->have_posts()) : $qry->the_post(); ?>
  53.     <item>
  54.         <title><?php the_title_rss() ?></title>
  55.         <link><?php the_permalink_rss() ?></link>
  56.         <comments><?php comments_link_feed(); ?></comments>
  57.         <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>  
  58.         <dc:creator><?php the_author() ?></dc:creator>
  59.         <itunes:author><?php the_author(); ?></itunes:author>
  60.         <?php the_category_rss() ?>
  61.  
  62.         <guid isPermaLink="false"><?php the_guid(); ?></guid>
  63. <?php if (get_option('rss_use_excerpt')) : ?>
  64.         <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
  65. <?php else : ?>
  66.         <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
  67.     <?php if ( strlen( $post->post_content ) > 0 ) : ?>
  68.         <content:encoded><![CDATA[<?php the_content_feed('rss2') ?>]]></content:encoded>
  69.     <?php else : ?>
  70.         <content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
  71.     <?php endif; ?>
  72. <?php endif; ?>
  73.         <slash:comments><?php echo get_comments_number(); ?></slash:comments>
  74. <?php rss_enclosure(); ?>
  75.     <?php do_action('rss2_item'); ?>
  76.     </item>
  77.     <?php endwhile; ?>
  78. </channel>
  79. </rss>
Add Comment
Please, Sign In to add comment