Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter mattfar

    (@mattfar)

    Hello Angelo,

    Thank you for your reply. Ple note that the image must be a thumbnail (or custom size)
    I tried the following with the following results:

    Try 1 RSS description format
    #_EVENTIMAGEURL <br/>#_EVENTDATES – #_EVENTTIMES <br/>#_LOCATIONNAME <br/>#_LOCATIONTOWN
    Not good as it only shows the code image URL in rss feed (eg htpps://#######.com/wp-content/uploads/2021/08/#######.jpg
    event title, dates, time, description good

    Try 2
    RSS description format
    <br/>#_EVENTDATES – #_EVENTTIMES <br/>#_LOCATIONNAME <br/>#_LOCATIONTOWN
    No errors but does not show image
    event title, dates, time, description good

    Try 3
    RSS description format
    #_EVENTIMAGE <br/>#_EVENTDATES – #_EVENTTIMES <br/>#_LOCATIONNAME <br/>#_LOCATIONTOWN
    Does not show image
    Shows: event title, dates, time,
    Does not show: event description

    Try 4
    <br/>#_EVENTDATES – #_EVENTTIMES <br/>#_LOCATIONNAME <br/>#_LOCATIONTOWN
    No errors but does not show image
    Shows: event title, dates, time, description

    I’ve also tried the code on this page https://wpism.com/image-wordpress-rss-feed/ (code below) in the function.php of my child theme but it does not work on the events rss feed. Perhaps because I am not using the eventimage or eventimageurl but would not know how to recode the below code with eventimage or eventimageurl properly

    <?php
    //This will prepend your WordPress RSS feed content with the featured image
    add_filter(‘the_content’, ‘smartwp_featured_image_in_rss_feed’);
    function smartwp_featured_image_in_rss_feed( $content ) {
    global $post;
    if( is_feed() ) {
    if ( has_post_thumbnail( $post->ID ) ){
    $prepend = ‘<div>’ . get_the_post_thumbnail( $post->ID, ‘medium’, array( ‘style’ => ‘margin-bottom: 10px;’ ) ) . ‘</div>’;
    $content = $prepend . $content;
    }
    }
    return $content;
    }`

Viewing 1 replies (of 1 total)