-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfeed-meeting.php
More file actions
49 lines (45 loc) · 1.32 KB
/
feed-meeting.php
File metadata and controls
49 lines (45 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
if (!defined('ABSPATH')) exit;
header('Content-Type: application/rss+xml; charset=' . get_option('blog_charset'), true);
echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
?>
<rss version="2.0">
<channel>
<title><?php bloginfo_rss('name'); ?> - Meetings</title>
<link><?php echo esc_url(home_url('/proudcity-meetings/')); ?></link>
<description><?php bloginfo_rss('description'); ?></description>
<language><?php bloginfo_rss('language'); ?></language>
<?php
$args = array(
'post_type' => 'meeting',
'posts_per_page' => 10,
'post_status' => 'publish',
'meta_key' => 'datetime',
'orderby' => 'meta_value',
'order' => 'ASC',
'meta_type' => 'DATETIME',
'meta_query' => array(
array(
'key' => 'datetime',
'value' => date('Y-m-d'),
'compare' => '>=',
'type' => 'DATETIME'
)
),
);
$meetings = new WP_Query($args);
while ($meetings->have_posts()) : $meetings->the_post();
?>
<item>
<title><?php the_title_rss(); ?></title>
<link><?php the_permalink_rss(); ?></link>
<guid><?php the_guid(); ?></guid>
<pubDate><?php echo get_the_date(DATE_RSS); ?></pubDate>
<description>
<![CDATA[<?php the_excerpt_rss(); ?>]]>
</description>
</item>
<?php endwhile;
wp_reset_postdata(); ?>
</channel>
</rss>