Modify RSS Feed with Video URL
-
Hello everyone!
I want to fetch the RSS feed of one of my websites to another using WP RSS Aggregator. This works fine, except for the video links.
On the source website, I choose “Video” as the post format and copy the Youtube-Link to the “oEmbed URL” field in the OceanWP settings of the post, but this link will not be passed to the RSS feed.
I guess it just needs a simple code for the Functions.php to make this possible. I found something in the internet, but unfortunately it is not helpful, because the link will simply be displayed as content in the feed, but I can’t map it as a custom field in the “WP RSS Agreggator” Plugin like that.
That’s the code I tried:
function wpb_rsstutorial_customfield($content) { global $wp_query; $postid = $wp_query->post->ID; $custom_metadata = get_post_meta($postid, 'ocean_post_oembed', true); if(is_feed()) { if($custom_metadata !== '') { // Display custom field data below content $content = $content."<br /><br /><div>".$custom_metadata."</div>"; } else { $content = $content; } } return $content; } add_filter('the_excerpt_rss','wpb_rsstutorial_customfield'); add_filter('the_content', 'wpb_rsstutorial_customfield');
As I found out, the custom field name where the oembed link is stored is named “ocean_post_oembed”.
Could you help me out with that? I attached a Screenshot of the field so that you know, which one I mean.
Thanks!
The page I need help with: [log in to see the link]
- The topic ‘Modify RSS Feed with Video URL’ is closed to new replies.