There are plug in they do display the image of the post of “rss feed page”.
not change the code because when you update the version of wp you erase everything the code ok?
I know there are plugins, I don’t know if these plugins work with events manager?? I don’t update wp core or plugin files! I move them into my child theme and update there.
I’d prefer to update code than add another plugin that loads a bunch of files that aren’t necessary. Considering that to add the images to your standard rss feed is a total of 13 lines of code, I’ll go that route!
Where are you using your code?
In my child functions.php file. It works great for the standard posts, just not for the event management posts. There seems to be only two files in the plugin that builds RSS feeds, em_rss.php and rss.php; I don’t see in either on how to add the image.
It could be a priorities problem with add_filter.
Another option would be to create a custom version of this file…
/events-manager/templates/templates/rss.php
…adding the_post_thumbnail function where you want the image to appear.
https://developer.wordpress.org/reference/functions/the_post_thumbnail/
This tutorial explains how to create custom templates that are upgrade-safe:
http://wp-events-plugin.com/documentation/using-template-files/
I thought this would work but it didn’t:
<item>
<title><?php echo $EM_Event->output( get_option('dbem_rss_title_format'), "rss" ); ?></title>
<link><?php echo $event_url; ?></link>
<guid><?php echo $event_url; ?></guid>
<pubDate><?php echo get_gmt_from_date(date('Y-m-d H:i:s', $EM_Event->start), 'D, d M Y H:i:s +0000'); ?></pubDate>
<description><![CDATA[<?php echo $description; ?>]]></description>
<image><? the_post_thumbnail( 'medium' ); ?></image>
</item>
I tried the above, and get_the_post_thumbnail and tried making it a variable first then put it in the <item>. Nothing…. grrrrr.
This shouldn’t be so difficult.
Oh, and the child rss.php file is working as the <image> tag was not there but is now, it’s just empty.
Well, I feel really stupid. I read the documentation and it’s all there, I just had to change some settings and now I have images in my RSS feed. While I was reading I found a few other tidbits that helped with some other issues.
I’d like to modify my RSS feed to include more fields. Is that described in the documentation? I haven’t found any mention of that. Perhaps a link? Thanks.
@garyhesse, here’s a link http://domain.com/wp-admin/edit.php?post_type=event&page=events-manager-options#formats
Open the RSS box and it’s all there. Look at the “RSS description format” and be sure to look at the info in the link there for “Event Related Placeholders”