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
- Disable RSS /feed/ endpoints on posts without disabling RSS overall
- Get the POST ID for RSS Feed
- Automatically load WordPress page on server every XX hours
- How to use custom fields to replace top-level parent title with an image using wp_list_pages?
- Forcing absolute src links in the RSS feed
- Fix My Custom Function: Remove Automatic
- PHP Puzzle: Unique Styles with PHP loop
- Change default comments form title [duplicate]
- Programmatically change post templates? [duplicate]
- custom contact form no longer working (because of 3.2?)
- Catchable fatal error in appcloud free theme by Tokokoo
- Add Column to Term Database
- File Upload with Server in safe_mode
- I want Page titles and excerpts to show up on home.php in certain order
- WP plugin updates [duplicate]
- Hide a nav menu item based on get_user_meta results
- Custom Archive Page
- How to change a specific character in a theme option value – replace a space with a plus sign
- Crop images in both sides on wordpress [duplicate]
- 2 small questions: How to redirect to a created page & show that pages title in wp, bp
- images are broken
- Custom query_posts() parameter
- How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?
- Incomplete term slugs output from a foreach loop with get_the_terms
- Posts sortable column not sorting properly for custom field numbers
- How to set if meta_value is lower < than other meta_value in a get_posts array?
- How to include support for all page types, calendar urls, archive, etc
- How can I add page template after post of a post type?
- Custom Shortcode with Dynamic Button
- Is it possible to display conditional HTML based on page name in wordpress?
- Global variables and re-use
- Cannot get custom javascript to execute on page
- How to declare a variable at the bottom of the page and use its value at the top?
- How do I modify the with wp_nav_menu()
- How to add custom checkout field in user details mail template
- The search engine of my website finds only posts and not pages, how can I solve this problem?
- MySQL update text field with ‘
- Pull GET parameter from URL in functions.php
- Shortcode working in page.php but not in category.php in wordpress
- Fatal error: Uncaught Error: Call to undefined function wp_nav_menu()
- How to NOT override inline css rules
- WP_Query based on another query on the page
- WordPress Memory limit not increasing
- Open all external links in new window – need help with the code
- What’s the best way to format ACF number fields for display on the front end?
- Create an unique ID number after submit form
- wp_head makes my custom page template not work in Customizer?
- static array on functions.php
- Adding Gravity Form With if(is_page) Is Not Working
- Cross origin ajax request always returns 0 when calling get_current_user_id();
- WooCommerce Custom Pagination
- ACF: Echo page title when checkbox is checked
- How to print array of specific item
- How can I re-use PHP code across different pages?
- Add Condition if WPBakery Page Builder Used on Page or Not
- js code not stored in database currectly
- Hide the content before the more tag in the “single page”
- Fetching wpdb data from a php file seems to break?
- Troubleshooting “loopback requests that take too long”
- Having an HTTP error 500 after migrating a website
- echo php values in table – strange behaviour, not all values are shown
- category & sub category order issues in wordpress
- Data inserted in database, but ajax calls error function
- AJAX & PHP | Call a specific PHP function from a PHP file via AJAX?
- Adding a Sub Menu Options Page WP Backend Menu. Whats wrong with my code?
- Changing posts date
- Redirect users not logged in to the standard login page (and back) from some posts and pages
- Why does a meta_query break this WP_Query?
- If I define a variable in header.php, how do I make it available to templates?
- Conditional in foreach loop is outputting content twice