feed-rdf.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. /**
  3. * RSS 1 RDF Feed Template for displaying RSS 1 Posts feed.
  4. *
  5. * @package WordPress
  6. */
  7. header( 'Content-Type: ' . feed_content_type( 'rdf' ) . '; charset=' . get_option( 'blog_charset' ), true );
  8. $more = 1;
  9. echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';
  10. /** This action is documented in wp-includes/feed-rss2.php */
  11. do_action( 'rss_tag_pre', 'rdf' );
  12. ?>
  13. <rdf:RDF
  14. xmlns="http://purl.org/rss/1.0/"
  15. xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  16. xmlns:dc="http://purl.org/dc/elements/1.1/"
  17. xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  18. xmlns:admin="http://webns.net/mvcb/"
  19. xmlns:content="http://purl.org/rss/1.0/modules/content/"
  20. <?php
  21. /**
  22. * Fires at the end of the feed root to add namespaces.
  23. *
  24. * @since 2.0.0
  25. */
  26. do_action( 'rdf_ns' );
  27. ?>
  28. >
  29. <channel rdf:about="<?php bloginfo_rss( 'url' ); ?>">
  30. <title><?php wp_title_rss(); ?></title>
  31. <link><?php bloginfo_rss( 'url' ); ?></link>
  32. <description><?php bloginfo_rss( 'description' ); ?></description>
  33. <dc:date><?php echo get_feed_build_date( 'Y-m-d\TH:i:s\Z' ); ?> </dc:date>
  34. <sy:updatePeriod>
  35. <?php
  36. /** This filter is documented in wp-includes/feed-rss2.php */
  37. echo apply_filters( 'rss_update_period', 'hourly' );
  38. ?>
  39. </sy:updatePeriod>
  40. <sy:updateFrequency>
  41. <?php
  42. /** This filter is documented in wp-includes/feed-rss2.php */
  43. echo apply_filters( 'rss_update_frequency', '1' );
  44. ?>
  45. </sy:updateFrequency>
  46. <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
  47. <?php
  48. /**
  49. * Fires at the end of the RDF feed header.
  50. *
  51. * @since 2.0.0
  52. */
  53. do_action( 'rdf_header' );
  54. ?>
  55. <items>
  56. <rdf:Seq>
  57. <?php
  58. while ( have_posts() ) :
  59. the_post();
  60. ?>
  61. <rdf:li rdf:resource="<?php the_permalink_rss(); ?>"/>
  62. <?php endwhile; ?>
  63. </rdf:Seq>
  64. </items>
  65. </channel>
  66. <?php
  67. rewind_posts();
  68. while ( have_posts() ) :
  69. the_post();
  70. ?>
  71. <item rdf:about="<?php the_permalink_rss(); ?>">
  72. <title><?php the_title_rss(); ?></title>
  73. <link><?php the_permalink_rss(); ?></link>
  74. <dc:creator><![CDATA[<?php the_author(); ?>]]></dc:creator>
  75. <dc:date><?php echo mysql2date( 'Y-m-d\TH:i:s\Z', $post->post_date_gmt, false ); ?></dc:date>
  76. <?php the_category_rss( 'rdf' ); ?>
  77. <?php if ( get_option( 'rss_use_excerpt' ) ) : ?>
  78. <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
  79. <?php else : ?>
  80. <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
  81. <content:encoded><![CDATA[<?php the_content_feed( 'rdf' ); ?>]]></content:encoded>
  82. <?php endif; ?>
  83. <?php
  84. /**
  85. * Fires at the end of each RDF feed item.
  86. *
  87. * @since 2.0.0
  88. */
  89. do_action( 'rdf_item' );
  90. ?>
  91. </item>
  92. <?php endwhile; ?>
  93. </rdf:RDF>