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
- Getting table to format properly in RSS feed emails
- Getting table to format properly in RSS feed emails
- How to check if a string is a valid URL
- Pass media upload value to input field
- What does the token %1$s in WordPress represent [closed]
- WordPress redirect to landing page if not logged in
- Remove class that has been added by parent theme
- I want to remove the links from the term list returned by get_the_term_list
- How to use a frontend URL with a Plugin
- Get list of shortcodes from content
- Adding Google Analytics code to the tag of specific pages
- Site Health : An active PHP session was detected
- How to display a value from a radio button in the options menu in wordpress
- Put php variable in shortcode
- Create Logout Link WordPress Admin Menu
- PHP in post content [closed]
- Display post image with fancybox
- Feed links not working even with add_theme_support(‘automatic-feed-links’)
- Linking text within textarea of custom meta box
- Ajax random number always the same
- How do you get final outputed HTML in PHP?
- How to change the oembed “type”?
- Post repeating with infinite scroll
- Automatic Shortcode Creation with Custom Fields [closed]
- wp-options keep crashing please help
- Post’s ID pattern?
- Countdown to date function?
- calling a custom field value inside functions.php
- User Meta Value not echoing despite Var_Dump Showing correct string
- WordPress check if current taxonomy has child
- Is there a name for trivial WP PHP files like functions.php, archive php entry.php, page.php and so forth?
- show something only when user comes from specific page at remote host?
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- array_rand not working correctly?
- How do I increase the upload size only when editing special pages?
- Adding php script to WordPress [closed]
- Remove category from pagination
- Function Display article [closed]
- Show login greeting above sub-menu links?
- Conditional On custom field plugin metabox
- Exclude function from running on a certain page
- wordpress sql posts query won’t display the latest post in a specific category
- How to load previous or next attachment with jquery ?
- Woocommerce Custom Meta Boxes- How to only display if they actually have content
- How to change image product page by variation in PHP code?
- duplicate posts with ajax load more wordpress
- Using ACF Relationship field to set post type to draft or published status
- Fetch Data from an external MSSQL Database in a Managed WP hosting
- Posts page (category) layout modification, which php file change?
- How to add WordPress Featured image in tag ..?
- Merge wp_get_post_terms
- Huge time to first byte on live site
- CPT in a shortcode
- All categories options or All categories not Populating
- WordPress load javascript file if something… (after the page is loaded)
- WordPress Shortcode based on other shortcode
- Force CSV download with template_redirect
- Insert double entry in DB
- Exclude Post ID from Array Specified in Custom Field
- Hide button based on PHP result
- WordPress display name string manipulation
- WordPress create new on site when a new page is added
- RSS feed – get specific item from external feed
- Embedded Feed Update
- Why does a meta_query break this WP_Query?
- Accessing WordPress Functions get_permalink() in Vanilla PHP?
- Create an if statement based on page_id
- Require Credits Footer
- Undefined variable notice [closed]
- Add topbar to static html page
- Add Woocommerce Customers link to custom admin menu
- How to access admin menu labels and links on front-end?