I want to add a custom feed on my site for SEO purposes.
So, I first copy the /wp-includes/feed-rss2.php file into my theme folder and renamed it. I figured I'll be able to easily edit my feed.
Then I add this code :
function yandex_news_feed() {load_template(TEMPLATEPATH . '/yandex-news.php'); }function yandexnews_add_feed() {add_feed('do_feed_yandexnews', 'yandex_news_feed');}add_action('init', 'yandexnews_add_feed');
I tried with many many ways and read a lot of documentation (almost always the same, a lot of people add rewrite_rules to the code but that's not the issue here) and source for add_feed
tell that rewrite rules are taken care of.
But, anyway, that's not working at all, weither i'm doing http://infoglam.exigences.biz/?feed=yandexnews or http://infoglam.exigences.biz/feed/yandexnews ; that's the same : blank page, empty, nothing.
Please note that if use volontarily incorrect name like http://infoglam.exigences.biz/?feed=yandexnews5 I get a error ERROR: yandexnews5 is not a valid feed template.
so it looks loke the feed name is registered, but the template isn't executed.
I have check permissions on template file, i tried with and without do_feed_
; I tried with include
instead of load_template()
I guess I could at the end use a template page with a blank page on the admin, but I find this not elegant - if efficient and quick. I will use several feeds on the site and I don't really want to deal with blank pages, and if I use the theme elsewhere I will need to create pages again, it will be best to have it concelead with the theme.
I guess the problem could be with the loading of the template but now I'm completely lost and cannot find where i'm doing it wrong.
Could someone give me a hand please ?