Add images to RSS feed of places?

This topic contains 5 replies, has 2 voices, and was last updated by  Stiofan O’Connor 6 years, 9 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #389833

    MyCity
    Free User
    Post count: 14

    Is there a way to make this code fit to allow images in rss feed?

    This is the code for the function file for regular posts

    
    
    function featuredtoRSS($content) {
    global $post;
    if ( has_post_thumbnail( $post->ID ) ){
    $content = '<div>' . get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'margin-bottom: 15px;' ) ) . '</div>' . $content;
    }
    return $content;
    }
     
    add_filter('the_excerpt_rss', 'featuredtoRSS');
    add_filter('the_content_feed', 'featuredtoRSS');
    #389872

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hello,

    I see no reason that should not work also, the first image of a GD listing is the featured image.

    Stiofan

    #389905

    MyCity
    Free User
    Post count: 14

    It doesn’t work though for whatever reason. Maybe I need to empty cache. I’ll try

    #389913

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    The RSS feeds are notoriously cache’y.. Try viewing it through a 3rd party website viewer

    Stiofan

    #390093

    MyCity
    Free User
    Post count: 14

    Yes it works! I’m always impatient! lol

    #390097

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Thanks for letting us know 🙂

Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket