RSS Feed Wordpress

Gehasi

New Member
Hey Guys,

im relatively new in Mailwizz but I want to start a Campaign which is getting its content from an RSS Feed. So far so good but I don't know how to tell wordpress to create the right RSS feed. I want to have the featured Image with an Short text. Does anybody did this before and can help me. I got this rss so far but it is not working:

dagmartin.de/de_de/feed

My template for Mailwizz looks like:

Code:
<!DOCTYPE html>
<html>
<head><meta charset="utf-8"/>
    <title></title>
</head>
<body>
<pre data-lang="html" data-xf-init="code-block" dir="ltr">

</pre>
<meta http-equiv="content-type" content="text/html" /></body>
</html>
<title></title>
[XML_FEED_BEGIN url='https://www.dagmartin.de/de_de/feed' count='5' offset='0']
<table>
    <tbody>
        <tr>
            <td><a href="[XML_FEED_ITEM_LINK]"><img height="100" src="[XML_FEED_ITEM_IMAGE]" width="100" /> </a> </td>
            <td><strong>[XML_FEED_ITEM_TITLE]</strong>
            <p>[XML_FEED_ITEM_DESCRIPTION]</p>
             </td>
        </tr>
    </tbody>
</table>
[XML_FEED_END]<br />
[COMPANY_FULL_ADDRESS], [UNSUBSCRIBE_LINK]

Thanks for all help.
 
I found a solution, which I post here for people who have the same challenge. I found the solution on

Article about RSS in Wordpress

In my functions.php of my wordpress child theme I added:

Code:
// Add Featured Image to the RSS-Feed
// Add namespace for media:image element used below
add_filter( 'rss2_ns', function(){
  echo 'xmlns:media="http://search.yahoo.com/mrss/"';
});

// insert the image object into the RSS item (see MB-191)
add_action('rss2_item', function(){
  global $post;
  if (has_post_thumbnail($post->ID)){
    $thumbnail_ID = get_post_thumbnail_id($post->ID);
    $thumbnail = wp_get_attachment_image_src($thumbnail_ID, 'large');
    if (is_array($thumbnail)) {
      echo '<media:content medium="image" url="' . $thumbnail[0]
        . '" width="' . $thumbnail[1] . '" height="' . $thumbnail[2] . '" />';
    }
  }
});

Have fun
 
@Gehasi than ks for the tip! I tried that, but I haven't had any luck :confused:

Can you give me any more insights? Do I need a plug in, or just this code?
What about that yahoo url? Do I need to replace it with my own feed?
Already tried all of the above but still not working.

Any help would be great!
Thanks.
 
Back
Top