Here is a great example. How to display featured post thumbnails in WordPress feeds
paste this code snippet in your theme functions.php file
// display featured post thumbnails in WordPress feeds
function wcs_post_thumbnails_in_feeds( $content ) {
global $post;
if( has_post_thumbnail( $post->ID ) ) {
$content="<p>" . get_the_post_thumbnail( $post->ID ) . '</p>' . $content;
}
return $content;
}
add_filter( 'the_excerpt_rss', 'wcs_post_thumbnails_in_feeds' );
add_filter( 'the_content_feed', 'wcs_post_thumbnails_in_feeds' );
Related Posts:
- Aspx/Rss feed – failed to open stream: Redirection limit reached
- How to access all meta data for RSS feed?
- Hide main div if wp_nav_menu is empty
- adding a filter to a shortcode?
- How to draw media details for Isotope gallery using Photoswipe
- Change the footer text on the login page
- Remove wp-mediaelement.css from wp_head
- Rewriting search and pagination base
- Copyright info change in Theme Child PHP
- show limited tags in an article
- Using a function written in my functions.php file within the header.php file
- Disable External Pingacks on WordPress Posts and Only Allow ‘Self Pings’
- Is the regular ajax request method safe or I should use admin-ajax.php?
- Create an array from an array
- Using wp_get_image_editor in a standalone script
- Woocommerce: Is it possible to overide the settings for allowing to purchase out of stock products [closed]
- Can I change a variable in a content part while calling it?
- page template for attachement page?
- WordPress Redirect: Default Password Reset URL [duplicate]
- PHP Deprecated: WP_RSSjb has a deprecated constructor
- Shortcode return function with link href inside PHP
- Set WordPress Default Template
- Can’t get page content in WordPress
- Function not working at one place
- Showing content from one page on another
- How to insert a single row to WP database table?
- Get date numerical and separate?
- How to check if a meta value has already been assigned to any user?
- How to prevent WP_Query function from returning all posts when empty?
- wp_trim_words() does not work with my code Am I doing any mistake in my code?
- How to call plugin function per site in a multisite?
- foreach loop still echoes array
- dynamic dependent select dropdown
- Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
- wp-comments-post.php file returns a blank page
- Add .htm extention to a custom taxonomy
- Custom gallery in wp3.5
- Noscript not working as it should in wordpress site
- How to use theme function in post/page?
- esc_url( ) won’t use https
- Pagination broken on is_front_page()
- Content filter won’t work
- Why does the post_type_link hook everything twice?
- Warning: in_array() null given in PHP function
- Use post ID in functions.php file adminside
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- use loop to return blog details
- How can I count ACF sub_field with a certain value
- Fetching Initials of the Commentator in the WordPress Website
- Adding function to child theme’s function.php
- Missing a text-domain esc_attr_e
- Custom posts password protect
- Extract and display user infromation on an automatically created page
- Is it legal to redefine wp_password_change_notification in a mu plugin?
- How can I assign separate stylesheets to different pages?
- Programmatically revert to backup .htaccess a possibility?
- Execute PHP code only with specific user role
- WP Container Displaying Only on First Page of Archive
- WordPress User Meta value variable into Google Gauge Chart
- Woocommerce – Exclude variation attribute on specific variation
- How do I add a function to parent theme
- PHP function for horizontal Woocommerce thumbnails and badges
- Add Pre-Defined Value to Click Counter in WordPress
- Embed video from streamtape using direct link
- Is there a PHP function that will return the block ID generated by WordPress?
- Creating a Function and Call It
- WooCommerce display price before add to cart [closed]
- Show sidebar only to author of post
- How to move a post from one category to another
- Show data obtained from a function and place it in a shortocode function
- how to add custom select field to wordpress edit page
- How to override theme’s public static function inside of a trait?
- Delete empty title_tags, find a h1 heading and echo it
- how to use 2 index.php file One for mobile and one for desktop
- WP_Query To Display Product Of Brand On Taxonomy Page
- Theme editing “post thumbnail” help
- How can I export data without using any import/export plugin
- Search for images that width and height is more than 500
- How to Request a User to Register on Landing at a Site, Then Automatically Delete the Users Password on Logout?
- Matching multi user
- Add disclaimer before certain posts and pages
- Where can I find the declaration of `$_wp_theme_features`?
- redirect 301 with special character like WIX site “#!”
- auto metakey value on post tile
- How do I routinely extract the thumbnail of the most recent post?
- wordpress ajax return 0
- How I can add div to menu?
- Modify category archive page loop on functions.php
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- How to print redirected query string variables to the page?
- Admin-area broken through weird issues
- Check if values exists DB
- Overwriting a Shortcode
- Search box background on a different page template
- WP Ecommerce: Display the “Order Notes” as column in the Sales Log [closed]
- How to modify this function to exclude also the post belonging to a specific category?
- A next page function with shortcode?
- What is the wrong with this function to enqueue the scripts and styles to the theme? [closed]
- How to limit the number of posts in the wordpress loop in conjunction with the “download more” button?
- how to create twitter card without plugin in wordpress website?