feed-support

deploy
campi 2 years ago
parent 9fec89f65c
commit 5a28605dd3

@ -1,15 +1,21 @@
<?php <?php
function add_shows_feed() { function add_shows_feed() {
add_feed( 'shows', 'render_shows_feed' ); add_feed( 'shows.xml', 'render_shows_feed' );
} }
add_action( 'init', 'add_shows_feed' ); add_action( 'init', 'add_shows_feed' );
function render_shows_feed() { function render_shows_feed() {
load_template(dirname(__FILE__)."/../feeds/radiomanifest-shows.php" ); load_template(dirname(__FILE__)."/../feeds/radiomanifest-shows.php" );
} }
// enable cors policy for every feed
function add_header_origin() {
if (is_feed()){
header( 'Access-Control-Allow-Origin: *' );
}
}
add_action( 'pre_get_posts', 'add_header_origin' );
?> ?>

Loading…
Cancel
Save