Forums

rss thumbnail url in new node (2 posts)

  1. RavHamster
    Member
    Posted 5 months ago #

    So i found this method to get the thumbnail with the rss feed, using this code, at the end of functions.php theme file

    // THIS INCLUDES THE THUMBNAIL IN OUR RSS FEED
    function insertThumbnailRSS($content) {
    global $post;
    if ( has_post_thumbnail( $post->ID ) ){
    $content = '' . get_the_post_thumbnail( $post->ID, 'thumbnail' ) . '' . $content;
    }
    return $content;
    }
    
    add_filter('the_excerpt_rss', 'insertThumbnailRSS');
    add_filter('the_content_feed', 'insertThumbnailRSS');

    From this thread

    http://wordpress.org/support/topic/thumbnailsfeatured-images-in-rss-feed-in-30

    Problem is that when i use it, the thumbnail gets in the description node of the rss feed, and i get the full html code for the image, not just the url.
    So it looks something like this
    <description><img src=blabla/>textfromthepost</description>

    How can i get only the url of the thumbnail, and put it inside its own node like <thumb></thumb>?

  2. RavHamster
    Member
    Posted 5 months ago #

    bump

Reply

You must log in to post.

About this Topic