Registering multiple custom feeds error
-
Hi folks,
Below is a snippet I got from an external wordpress tutorial site to register a custom RSS feed.add_action('init', 'customRSS'); function customRSS(){ add_feed('tab', 'customRSSFunc'); } function customRSSFunc(){ get_template_part('rss', 'tab'); }
I’d like to expand into multiple RSS feeds, and my code looked exactly like this guy’s code on WordPress stackexchange. It “works perfectly” for him, but I’m getting a php error saying I can’t declare customRSS again. To be very clear, I had the exact same code except with my own RSS title values.
// Custom Feed 1 add_action('init', 'customRSS'); function customRSS(){ add_feed('feedname', 'customRSSFunc'); } function customRSSFunc(){ get_template_part('rss', 'feedname'); } // Custom Feed 2 add_action('init', 'customRSS2'); function customRSS2(){ add_feed('feedname2', 'customRSS2Func'); } function customRSS2Func(){ get_template_part('rss', 'feedname2'); }
Can someone point out what I’m not seeing here?
Thank you
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Registering multiple custom feeds error’ is closed to new replies.