author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:40:08 +0200 | |
changeset 21 | 48c4eec2b7e6 |
parent 19 | 3d72ae0968f4 |
child 22 | 8c2e4d02f4ef |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
3 |
* Atom Feed Template for displaying Atom Posts feed. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
*/ |
|
7 |
||
9 | 8 |
header( 'Content-Type: ' . feed_content_type( 'atom' ) . '; charset=' . get_option( 'blog_charset' ), true ); |
0 | 9 |
$more = 1; |
10 |
||
9 | 11 |
echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>'; |
5 | 12 |
|
13 |
/** This action is documented in wp-includes/feed-rss2.php */ |
|
14 |
do_action( 'rss_tag_pre', 'atom' ); |
|
15 |
?> |
|
0 | 16 |
<feed |
9 | 17 |
xmlns="http://www.w3.org/2005/Atom" |
18 |
xmlns:thr="http://purl.org/syndication/thread/1.0" |
|
19 |
xml:lang="<?php bloginfo_rss( 'language' ); ?>" |
|
20 |
<?php |
|
21 |
/** |
|
22 |
* Fires at end of the Atom feed root to add namespaces. |
|
23 |
* |
|
24 |
* @since 2.0.0 |
|
25 |
*/ |
|
26 |
do_action( 'atom_ns' ); |
|
27 |
?> |
|
28 |
> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
29 |
<title type="text"><?php wp_title_rss(); ?></title> |
9 | 30 |
<subtitle type="text"><?php bloginfo_rss( 'description' ); ?></subtitle> |
0 | 31 |
|
9 | 32 |
<updated><?php echo get_feed_build_date( 'Y-m-d\TH:i:s\Z' ); ?></updated> |
0 | 33 |
|
9 | 34 |
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php bloginfo_rss( 'url' ); ?>" /> |
35 |
<id><?php bloginfo( 'atom_url' ); ?></id> |
|
0 | 36 |
<link rel="self" type="application/atom+xml" href="<?php self_link(); ?>" /> |
37 |
||
38 |
<?php |
|
39 |
/** |
|
40 |
* Fires just before the first Atom feed entry. |
|
41 |
* |
|
42 |
* @since 2.0.0 |
|
43 |
*/ |
|
44 |
do_action( 'atom_head' ); |
|
45 |
||
9 | 46 |
while ( have_posts() ) : |
47 |
the_post(); |
|
48 |
?> |
|
0 | 49 |
<entry> |
50 |
<author> |
|
9 | 51 |
<name><?php the_author(); ?></name> |
16 | 52 |
<?php |
53 |
$author_url = get_the_author_meta( 'url' ); |
|
54 |
if ( ! empty( $author_url ) ) : |
|
55 |
?> |
|
56 |
<uri><?php the_author_meta( 'url' ); ?></uri> |
|
9 | 57 |
<?php |
58 |
endif; |
|
0 | 59 |
|
60 |
/** |
|
61 |
* Fires at the end of each Atom feed author entry. |
|
62 |
* |
|
63 |
* @since 3.2.0 |
|
64 |
*/ |
|
65 |
do_action( 'atom_author' ); |
|
9 | 66 |
?> |
0 | 67 |
</author> |
16 | 68 |
|
9 | 69 |
<title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss(); ?>]]></title> |
70 |
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php the_permalink_rss(); ?>" /> |
|
16 | 71 |
|
9 | 72 |
<id><?php the_guid(); ?></id> |
73 |
<updated><?php echo get_post_modified_time( 'Y-m-d\TH:i:s\Z', true ); ?></updated> |
|
74 |
<published><?php echo get_post_time( 'Y-m-d\TH:i:s\Z', true ); ?></published> |
|
75 |
<?php the_category_rss( 'atom' ); ?> |
|
16 | 76 |
|
0 | 77 |
<summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary> |
16 | 78 |
|
9 | 79 |
<?php if ( ! get_option( 'rss_use_excerpt' ) ) : ?> |
16 | 80 |
<content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss(); ?>"><![CDATA[<?php the_content_feed( 'atom' ); ?>]]></content> |
9 | 81 |
<?php endif; ?> |
16 | 82 |
|
9 | 83 |
<?php |
84 |
atom_enclosure(); |
|
16 | 85 |
|
9 | 86 |
/** |
87 |
* Fires at the end of each Atom feed item. |
|
88 |
* |
|
89 |
* @since 2.0.0 |
|
90 |
*/ |
|
91 |
do_action( 'atom_entry' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
92 |
|
9 | 93 |
if ( get_comments_number() || comments_open() ) : |
94 |
?> |
|
18 | 95 |
<link rel="replies" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php the_permalink_rss(); ?>#comments" thr:count="<?php echo get_comments_number(); ?>" /> |
96 |
<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(); ?>" /> |
|
16 | 97 |
<thr:total><?php echo get_comments_number(); ?></thr:total> |
9 | 98 |
<?php endif; ?> |
0 | 99 |
</entry> |
9 | 100 |
<?php endwhile; ?> |
0 | 101 |
</feed> |