FYI, you should never hack the WordPress core files. Instead, WordPress provides the handy rss2_item
action hook. All we need to do is check if we’re on a category feed or not:
function wpse_99336_category_feed_item() {
if ( is_category() && get_the_post_thumbnail() ) {
printf ( '<featured-item>%s</featured-item>',
wp_get_attachment_url( get_post_thumbnail_id() )
);
}
}
add_action( 'rss2_item', 'wpse_99336_category_feed_item' );
Related Posts:
- Remove a div from RSS feed
- Can I add the post featured image to a specific RSS feed?
- Aspx/Rss feed – failed to open stream: Redirection limit reached
- WordPress create custom XML RSS feed template
- A custom RSS feed link, how do I modify the XML structure?
- How to Add Image to WordPress RSS-Feed with no Plug-in?
- How to check if feed URL was requested?
- Disable comment rss feeds for pages in wordpress
- Twitter feed is showing blank in WP site [closed]
- Getting Post Thumbnail from RSS feed with SimplePie
- fetch_feed: retrieve entries in the appearing order, not chronologically
- Limiting the WordPress feed to only a certain limit of characters
- Why does running get_the_excerpt() when generating JSON file take 28 seconds vs. 599 milliseconds without it?
- get post content of particular post by url
- Display image from an external rss feed on wordpress without plugins
- How to modify the default feed via a function
- Can’t retrieve element with WordPress default @fetch_rss();
- Include only posts with meta key “add_in_rss” in RSS Feed
- change default RSS feed URL
- Display WordPress Post on A Different Site
- Good RSS Feed Parser to use on php file?
- Disable category RSS Feeds on WordPress blog with PHP
- How to access all meta data for RSS feed?
- Remove all feeds and return custom 404 page
- Use fetch_feed(); Totally Outside of WordPress?
- truncating imported rss-feeds
- Dynamically Create Posts Via XML File
- PHP warning: Undefined array key 2 in feed.php
- How to declare a global variable in php?
- Undefined variable in functions.php file [closed]
- Mega Menu Walker
- How to get SimplePie fetch_feed without stripping iframe code?
- Why would a GET variable one one page of a site cause a 404 error when a GET variable works on another page of a site?
- load/require specific php files for specific pages/templates/post types
- Activate different theme for temporary preview
- Store loop into array
- Add a custom text field to WooCommerce admin product data “Variations”
- Show Specific Footer Widget for Specific Pages
- How do I output a database option that is an array into a get_posts array?
- Why is it necessary to prevent direct access to included files?
- Run a Parallel PHP Application with WordPress
- How can I use a $wp_customize to edit my homepage image slider?
- Password protecting content in custom template
- Creating login session via CURL
- WordPress vs. Custom PHP [closed]
- How to Display a Single Post Excerpt
- Trouble With Conditional Logic in PHP
- How to Highlight unread WordPress posts?
- How can I exclude tags from category_rss function?
- Removing “wpautop” (auto tags) only on certain pages?
- selected option if current category is the value
- Alert Bar section within WP loop is displaying even though there are no posts
- Load wordpress content in other domain
- Search Query: how to construct a search string from two select elements?
- Is it possible to retrieve all posts with a certain value for metadata?
- How to set up a If is_singular statement?
- How to hook code to show after the_content?
- Creating WordPress Shortcode with Variable
- Catchable fatal error: Object of class stdClass could not be converted to string
- variable value disappears in a second loop
- unknown issue in ‘header.php’ preventing theme from displaying fully
- Add meta tags to a custom header
- Ajax filter button display all posts
- Check If Post Was Published More Than 6 Months Ago Using get_the_date
- Function sanitize_title() does not appear to be working
- random display categories – change url
- Nav menu from plugin to theme
- Generate responsive post thumbnails of same size
- How to prevent a function from running based on host (ie web vs local)?
- Change out put of the_post_thumbnail in PHP
- WordPress permalink issue
- Delete images from media library when user deletes an image from ACF Gallery
- Array data not saving to specified sections. How to make seting independantly?
- How to get woocommerce orders with get_posts method in a shortcode
- Integrate otp in my custom singup form
- Change category thumbnail size
- Need to show 7 posts from actual date
- How to reload a php script, using AJAX and jQuery
- Make wp_editor required
- I need to edit a widget, with no dashboard access
- Add custom ID attribute to all woocommerce products on archive pages
- problem in using wpdb->prepare and a string placeholder
- Custom content using in_category
- Get the total Author Favorited posts
- Need help with PHP functions
- WordPress WPDB::insert 13th param is always blank (only if format)
- When using shortcode, content stops generating after the_content
- How do you detect if a specific word is at the end of a the_title()
- WordPress styling recent post
- Combining fancybox with multiple thumbnail plugin
- How to display thumbnail if post is assigned one otherwise not
- How to check “From Email” via WordPress before an email is sent
- Php echo into tag
- Add specific phrase after every product title including the discounted price? [closed]
- Remove Unused Menu Locations
- How do I change the Go To Categories link in the term_updated_messages
- How to sort wordpress posts by selecting a year from a drop down?
- WooCommerce Checkout Cart [closed]
- How can I get values from a custom post type depending on where I click on my SVG map?
- WordPress taxonomy and terms question