Guest User

The Events Calendar PRO RSS feed for today

a guest
Jul 25th, 2013
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.14 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Today at the Moon Feed
  4. */
  5.  
  6. header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
  7. $more = 1;
  8.  
  9. global $post;
  10. //$current_date = date('j M Y');
  11. $current_date = date('Y-m-d');
  12. $end_date = date('Y-m-d', strtotime('1 days'));
  13. //$end_date = $current_date;
  14.  
  15. $get_posts = tribe_get_events(array('start_date'=>$current_date,'end_date'=>$end_date,'posts_per_page'=>10,'eventDisplay'=>'all') );
  16.  
  17. echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
  18.  
  19. <rss version="2.0"
  20.     xmlns:content="http://purl.org/rss/1.0/modules/content/"
  21.     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  22.     xmlns:dc="http://purl.org/dc/elements/1.1/"
  23.     xmlns:atom="http://www.w3.org/2005/Atom"
  24.     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  25.     xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  26.     <?php do_action('rss2_ns'); ?>
  27. >
  28.  
  29. <channel>
  30.     <title><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
  31.     <atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
  32.     <link><?php bloginfo_rss('url') ?></link>
  33.     <description><?php bloginfo_rss("description") ?></description>
  34.     <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
  35.     <language><?php echo get_option('rss_language'); ?></language>
  36.     <sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
  37.     <sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>
  38.     <?php do_action('rss2_head'); ?>
  39.     <?php foreach($get_posts as $post) { setup_postdata($post);
  40.         //if (tribe_is_event($post) && tribe_get_start_date($post, false, 'Y-m-d') != $current_date) continue; ?>
  41.     <item>
  42.         <title><?php the_title_rss() ?></title>
  43.         <link><?php the_permalink_rss() ?></link>
  44.         <comments><?php comments_link_feed(); ?></comments>
  45.         <?php if (tribe_is_event()): //if (get_post_type() == 'tribe_events'): ?>
  46.         <pubDate><?php echo mysql2date('D, d M Y H:i:s -0004', tribe_get_start_date($post->ID, true, 'Y-m-d H:i:s -0004'), false); ?></pubDate>
  47.         <?php else: ?>
  48.         <pubDate><?php echo mysql2date('D, d M Y H:i:s -0004', get_post_time('Y-m-d H:i:s -0004', true), false); ?></pubDate>
  49.         <?php endif; ?>
  50.         <dc:creator><?php the_author() ?></dc:creator>
  51.         <?php the_category_rss('rss2') ?>
  52.  
  53.         <guid isPermaLink="false"><?php the_guid(); ?></guid>
  54. <?php if (get_option('rss_use_excerpt')) : ?>
  55.         <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
  56. <?php else : ?>
  57.         <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
  58.     <?php if ( strlen( $post->post_content ) > 0 ) : ?>
  59.         <content:encoded><![CDATA[<?php the_content_feed('rss2') ?>]]></content:encoded>
  60.     <?php else : ?>
  61.         <content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
  62.     <?php endif; ?>
  63. <?php endif; ?>
  64.         <wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss>
  65.         <slash:comments><?php echo get_comments_number(); ?></slash:comments>
  66. <?php rss_enclosure(); ?>
  67.     <?php do_action('rss2_item'); ?>
  68.     </item>
  69.     <?php } ?>
  70. </channel>
  71. </rss>
Advertisement
Add Comment
Please, Sign In to add comment