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