Custom RSS feed goes blank
-
I’m perplexed by this problem and hope someone knows what is doing on. I have a plugin that puts out an RSS feed. But often the output is a blank page or (if you put the url for the rss feed in Firefox, it will go nowhere). To make thing simple, here is the code with some dummy rss item.
Now, here is where it gets strange. If I take out the echo comment (done), the feed will work (but then it has the word done at the start).
Here is a live url for this feed (without the echo of “done”)
http://www.wprssimporter.com?feed=amw
I have no idea what is going on….can anybody help here? Thanks.
add_action('init', 'rssmi_rss'); function rssmi_rss(){ add_feed('amw', 'get_my_feed'); //echo "done"; } function get_my_feed(){ header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true); echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> <rss version="0.92"> <channel> <title><?php bloginfo_rss('name'); wp_title_rss(); ?></title> <link><?php bloginfo_rss('url') ?></link> <description><?php bloginfo_rss('description') ?></description> <lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate> <docs>http://backend.userland.com/rss092</docs> <language><?php bloginfo_rss( 'language' ); ?></language> <item> <title>Dummy Title</title> <description>The Excerpt</description> <link>The Link</link> </item> </channel> </rss> <?php }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Custom RSS feed goes blank’ is closed to new replies.