25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

94 lines
3.0 KiB

  1. <?php
  2. /**
  3. * Atom Feed Template for displaying Atom Posts feed.
  4. *
  5. * @package WordPress
  6. */
  7. header('Content-Type: ' . feed_content_type('atom') . '; 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', 'atom' );
  12. ?>
  13. <feed
  14. xmlns="http://www.w3.org/2005/Atom"
  15. xmlns:thr="http://purl.org/syndication/thread/1.0"
  16. xml:lang="<?php bloginfo_rss( 'language' ); ?>"
  17. xml:base="<?php bloginfo_rss('url') ?>/wp-atom.php"
  18. <?php
  19. /**
  20. * Fires at end of the Atom feed root to add namespaces.
  21. *
  22. * @since 2.0.0
  23. */
  24. do_action( 'atom_ns' );
  25. ?>
  26. >
  27. <title type="text"><?php wp_title_rss(); ?></title>
  28. <subtitle type="text"><?php bloginfo_rss("description") ?></subtitle>
  29. <updated><?php
  30. $date = get_lastpostmodified( 'GMT' );
  31. echo $date ? mysql2date( 'Y-m-d\TH:i:s\Z', $date ) : date( 'Y-m-d\TH:i:s\Z' );
  32. ?></updated>
  33. <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php bloginfo_rss('url') ?>" />
  34. <id><?php bloginfo('atom_url'); ?></id>
  35. <link rel="self" type="application/atom+xml" href="<?php self_link(); ?>" />
  36. <?php
  37. /**
  38. * Fires just before the first Atom feed entry.
  39. *
  40. * @since 2.0.0
  41. */
  42. do_action( 'atom_head' );
  43. while ( have_posts() ) : the_post();
  44. ?>
  45. <entry>
  46. <author>
  47. <name><?php the_author() ?></name>
  48. <?php $author_url = get_the_author_meta('url'); if ( !empty($author_url) ) : ?>
  49. <uri><?php the_author_meta('url')?></uri>
  50. <?php endif;
  51. /**
  52. * Fires at the end of each Atom feed author entry.
  53. *
  54. * @since 3.2.0
  55. */
  56. do_action( 'atom_author' );
  57. ?>
  58. </author>
  59. <title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss() ?>]]></title>
  60. <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php the_permalink_rss() ?>" />
  61. <id><?php the_guid() ; ?></id>
  62. <updated><?php echo get_post_modified_time('Y-m-d\TH:i:s\Z', true); ?></updated>
  63. <published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published>
  64. <?php the_category_rss('atom') ?>
  65. <summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
  66. <?php if ( !get_option('rss_use_excerpt') ) : ?>
  67. <content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><![CDATA[<?php the_content_feed('atom') ?>]]></content>
  68. <?php endif; ?>
  69. <?php atom_enclosure();
  70. /**
  71. * Fires at the end of each Atom feed item.
  72. *
  73. * @since 2.0.0
  74. */
  75. do_action( 'atom_entry' );
  76. if ( get_comments_number() || comments_open() ) :
  77. ?>
  78. <link rel="replies" type="<?php bloginfo_rss('html_type'); ?>" href="<?php the_permalink_rss() ?>#comments" thr:count="<?php echo get_comments_number()?>"/>
  79. <link rel="replies" type="application/atom+xml" href="<?php echo esc_url( get_post_comments_feed_link(0, 'atom') ); ?>" thr:count="<?php echo get_comments_number()?>"/>
  80. <thr:total><?php echo get_comments_number()?></thr:total>
  81. <?php endif; ?>
  82. </entry>
  83. <?php endwhile ; ?>
  84. </feed>