PageRenderTime 43ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/wordpress3.4.2/wp-includes/feed-rss2.php

https://bitbucket.org/ch3tag/mothers
PHP | 60 lines | 50 code | 5 blank | 5 comment | 4 complexity | ca685a533e399f2c687d6760b4929556 MD5 | raw file
  1. <?php
  2. /**
  3. * RSS2 Feed Template for displaying RSS2 Posts feed.
  4. *
  5. * @package WordPress
  6. */
  7. header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
  8. $more = 1;
  9. echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
  10. <rss version="2.0"
  11. xmlns:content="http://purl.org/rss/1.0/modules/content/"
  12. xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  13. xmlns:dc="http://purl.org/dc/elements/1.1/"
  14. xmlns:atom="http://www.w3.org/2005/Atom"
  15. xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  16. xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  17. <?php do_action('rss2_ns'); ?>
  18. >
  19. <channel>
  20. <title><?php bloginfo_rss('name'); wp_title_rss(); ?></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 bloginfo_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. <?php do_action('rss2_head'); ?>
  29. <?php while( have_posts()) : the_post(); ?>
  30. <item>
  31. <title><?php the_title_rss() ?></title>
  32. <link><?php the_permalink_rss() ?></link>
  33. <comments><?php comments_link_feed(); ?></comments>
  34. <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
  35. <dc:creator><?php the_author() ?></dc:creator>
  36. <?php the_category_rss('rss2') ?>
  37. <guid isPermaLink="false"><?php the_guid(); ?></guid>
  38. <?php if (get_option('rss_use_excerpt')) : ?>
  39. <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
  40. <?php else : ?>
  41. <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
  42. <?php if ( strlen( $post->post_content ) > 0 ) : ?>
  43. <content:encoded><![CDATA[<?php the_content_feed('rss2') ?>]]></content:encoded>
  44. <?php else : ?>
  45. <content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
  46. <?php endif; ?>
  47. <?php endif; ?>
  48. <wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss>
  49. <slash:comments><?php echo get_comments_number(); ?></slash:comments>
  50. <?php rss_enclosure(); ?>
  51. <?php do_action('rss2_item'); ?>
  52. </item>
  53. <?php endwhile; ?>
  54. </channel>
  55. </rss>