Answer the question
In order to leave comments, you need to log in
Wordpress: Why is the custom feed not working?
I add to functions.php in the theme:
add_action( 'init', function(){
add_feed( 'smartprice', 'smartprice_markup' );
});
function smartprice_markup() {
do_action( 'my_before_feed' );
header( 'Content-Type: ' . feed_content_type( 'rss' ) . '; charset=' . get_option( 'blog_charset' ), true );
status_header( 200 );
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
<channel>
<?php
...
?>
</channel>
</rss>
<?php
exit;
}
smartprice_markup();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question