Tagged: , , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #615440

    Hi,

    I was wondering if there was on option in the enfold theme allowing to include the featured image of a post directly into the rss feed.

    I found a solution adding some code in the functions.php file but I thought this would be directly customizable in the theme options.

    If it’s not and for those who are interested, here is the code to add in you functions.php file (I found it on this forum from a 3 years old topic. I just tweaked itby adding a link to the post on the image) :

    function avia_add_images_to_rss_feed($content)
    {
    	global $post;
    	if ( has_post_thumbnail( $post->ID ) )
    	{
    		$content = '<a href="' . get_permalink() . '">' . get_the_post_thumbnail( $post->ID, 'full', array( 'style' => 'display: block;' ) ) . '</a><br/>' . $content;
    	}
    	return $content;
    }
    
    add_filter('the_excerpt_rss', 'avia_add_images_to_rss_feed');
    add_filter('the_content_feed', 'avia_add_images_to_rss_feed');
    
    #617146

    Hey smartwithyou!

    Thank you for using Enfold.

    Yes, it is working but the thumbnail is a bit too big. Replace “full” with a smaller thumbnail.

    Best regards,
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.