开发者

Add custom feed to Wordpress: add_feed or do_feed

I have an existing custom feed using do_feed_* but I see there is an undocumented (and existing since 2.1) *_add_feed. Is one better than the other?

I have do_feed_* working but since I upgraded to 3.0 last week, any URL with "&author=" in it redirects to the root site page. Take 开发者_开发知识库it out and it loads the page fine (but of course does not show the proper author). So, as I investigate, I wonder if *_add_feed might be better?


Relying on an undocumented method in any API is more dangerous than figuring out how to properly use a documented method.


add_feed is the best starting point and is now a documented part of WordPress. This function has been in WordPress since v2.1.

You should prefer adding your custom feed using add_feed over do_feed_*. An example of how to add your own custom RSS feed to WordPress is discussed on the WordPress Answers site: Cannot get add_feed to work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜