There is no hook in the template. See wp-includes/feed-rss2.php
:
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
<rss version="2.0"
You have to replace the template with a complete new one. The template is loaded on the action do_feed_rss2
. From wp-includes/default-filters.php
:
add_action( 'do_feed_rss2', 'do_feed_rss2', 10, 1 );
Now you can remove the original action and add your own:
remove_action( 'do_feed_rss2', 'do_feed_rss2' );
add_action( 'do_feed_rss2', 'wpse_119139_feed_rss2', 10, 1 );
function wpse_119139_feed_rss2( $for_comments )
{
if ( $for_comments )
load_template( 'path_to_custom_comment_feed_template' );
else
load_template( 'path_to_custom_regular_feed_template' );
}