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' );
}
Related Posts:
- Firefox is downloading the RSS feed
- Multiple versions of RSS feed? One with full content, one with the excerpt
- Why does Simplepie return feed items in a wrong order?
- Download an entire blog for offline reading / archival (without using RSS feed)
- How to flush feed? Or set timeout on feed so that it isn’t cached?
- Disable RSS Feed
- Reducing image size in RSS only
- Add featured image to RSS feed through child theme functions.php file
- Change the link URL in default RSS feeds
- How to create a Full RSS feed (secret URL) for certain users, short for the rest [closed]
- placement of wp_error with fetch_feed
- image thumbnail in RSS Feed
- RSS feed of previous 24 hours posts?
- RSS feeds and wordpress?
- How to get more than 25 items via Simplepie RSS Feeds?
- How to remove RSS feeds from WordPress theme
- Changing RSS title link to link to feed instead of blog
- Delaying One RSS Feed in WordPress but Not the Others?
- Non-UTF characters break RSS feed
- Grab YouTube Thumbnail AFTER Post?
- How can I post Facebook fan page status updates to my WordPress blog?
- Inserting ads into wordpress default rss feeds
- How fetch_feed() works?
- how to make function in RSS feed like it does in posts
- Help needed to make my site as Aggregator
- How to Update SimplePie
- How can I migrate to worpress using my last blog’s rss
- What’s a good RSS Importer?
- What flash slideshow player can read an rss feed as a source?
- How can I remove a RSS feed that a WordPress plugin adds to `wp_head()`?
- Problem with getting RSS because of authentication
- Podcast set up within a page, or, adding a /feed to a page
- Is there a way to change and hide the RSS Feed permalink?
- Featured Image on custom rss templet
- How do I control what gets posted on the RSS Feed and Custom Feeds
- Does get_the_content_feed strip invalid tags?
- RSS Feed Sticky Post?
- Custom Feed URLs
- Force use of RSS 0.92 feed
- Getting Thumbnail in fetch_feed from custom field
- Force the_content() to show full post in RSS feed
- Get full content from feeds and save a duplicate copy in my site
- WP HTTP Error: couldn’t connect to host for RSS feeds on same domain
- Add extra content to RSS feed
- Unable to display favicon using get_favicon()?
- Passing feed URLs with “&” to fetch_feed()?
- Empty RSS Feeds
- How to change wordpress RSS to be in a specific format?
- Show Top 10 posts in a rss feed
- RSS and Post edits
- RSS/Atom feeds invalid, “Mismatched tag” errors
- How to make an RSS feed to show most viewed posts for last 24 hours?
- Why this thumbnail hard crop code does not work?
- WordPress content on non-WP site residing on a remote domain — how to display posts?
- Site Migration to WordPress: Handling Feeds
- get_item_quantity() Error When Fetching Feed
- Display external RSS feed on pages
- Control time of addition of posts to RSS?
- RSS feed not Refreshes
- RSS Feeds not working in Chrome/ok in IE and Firefox
- Get RSS feed about plugin new update
- Issue with RSS Feed in Firefox and Safari
- WordPress won’t let me use a page slug of ‘feed’
- Is a no RSS plugin setup supposed to work?
- My WordPress installation isn’t updating the feed when a new post is published
- Exporting post info into a formatted table and into MailChimp as automated as possible
- Remove post content in RSS feed?
- How can I add certain pages (not posts) to my sites RSS feed?
- RSS feed has stopped updating
- Cannot Load a Specific RSS Feed to WordPress
- Showing Taxonomy Terms in RSS Feed
- Modify RSS feed to change iframe structure
- RSS Feed has older items at the top
- RSS Feed cURL error 52?
- How do I fix feed error?
- Category RSS Feed – Article Title not being detected
- Is there any harm in using RSS.php (or other deprecated features)?
- Site requires login. How to publish login-free RSS feed?
- WordPress removes namespace part from my tags in RSS feed
- Error on Rss Feed for my blog
- My wordpress blog RSS isn’t showing
- Custom rss feed template – Get featured image and custom fields
- RSS Feed Broken – Limit?
- RSS Feed to contain posts from 1 category only
- wp_head hook content showing up at top of RSS feed
- RSS2 Feed with two CDATA sections
- How to debug/diagnose RSS feed that’s not working?
- RSS feed – get specific item from external feed
- Embedded Feed Update
- WP app getting confused about posts and pages
- How can I define the RSS feed content length?
- How to add the Author on my RSS Feed
- How do I enable my WordPress website RSS feed? My site doesn’t seem to have an RSS feed
- WordPress not showing the latest articles in RSS feed
- PLEASE help me to get my RSS feed working [closed]
- Feed RSS problem on WordPress, need it for Google News
- Caching & Outputting RSS Data
- WordPress Feed Error [closed]
- Add Custom postmeta Fields to Custom Post Type RSS in wordpress
- Extracting Channel Data from fetch_feed()