Embed RSS (XML) on campaign

Below works just fine
Code:
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:media="http://purl.org/rss/1.0/modules/media/"
    >

<channel>
    <title>Colégio Piaget</title>
    <atom:link href="http://www.piaget.g12.br/feed/" rel="self" type="application/rss+xml" />
    <link>http://www.piaget.g12.br</link>
    <description>Colégio Piaget. Educação Infantil, Fundamental e Médio. Conheça os Diferenciais e Veja Por Que o Colégio Piaget foi Feito Para Quem Quer Mais. Escola Particular SP</description>
    <lastBuildDate>Mon, 13 Apr 2015 18:28:20 +0000</lastBuildDate>
    <language>pt-BR</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <generator>http://wordpress.org/?v=4.1.1</generator>
    <item>
        <title>O Corpo Humano</title>
        <link>http://www.piaget.g12.br/o-corpo-humano/</link>
        <comments>http://www.piaget.g12.br/o-corpo-humano/#comments</comments>
        <pubDate>Mon, 13 Apr 2015 18:28:20 +0000</pubDate>
        <dc:creator><![CDATA[Colegio Piaget]]></dc:creator>
                <category><![CDATA[Acontece]]></category>
        <category><![CDATA[atividade em sala]]></category>

        <guid isPermaLink="false">http://www.piaget.g12.br/?p=919892</guid>
        <description><![CDATA[Você cuida do seu corpo? Saiba que você é muito especial e por isso precisa se cuidar! Cuidar da sua alimentação, da sua higiene, do tempo de brincar, de aprender, de dormir&#8230; Conhecer melhor o seu corpo, conhecer o outro, fazer amigos&#8230; Viver com mais saúde e ser feliz! Os alunos têm uma curiosidade natural...]]></description>
        <wfw:commentRss>http://www.piaget.g12.br/o-corpo-humano/feed/</wfw:commentRss>
        <slash:comments>0</slash:comments>
      <media:content>http://www.piaget.g12.br/wp-content/uploads/2015/04/img_0392-200x150.jpg</media:content>
    </item>
    </channel>
</rss>
pay attention to the heading:
Code:
xmlns:media="http://purl.org/rss/1.0/modules/media/"
and also to how the media item is added:
Code:
<media:content>http://www.piaget.g12.br/wp-content/uploads/2015/04/img_0392-200x150.jpg</media:content>

One more thing in your case, if you look at http://www.piaget.g12.br/feed/ it is NOT a valid feed. That is because WP Cache spits some output in the page:
Code:
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/
Page Caching using disk: enhanced
Served from: www.piaget.g12.br @ 2015-04-13 15:28:44 by W3 Total Cache -->

So i'd say you should disable that as well while testing.
 
Disable wp total cache for that page.


Sorry, but I did not understand about the other observation!! could you help!?
I think i did, didn't i ? :)
Make sure your start of document (view page source) contains the media namespace, that is, contains this declaration:
Code:
xmlns:media="http://purl.org/rss/1.0/modules/media/"
like i shown you above.
 
Hi!!! now I could make it WORK!!!
The only problem was not having the code below in the RSS Feed.
Code:
xmlns:media="http://purl.org/rss/1.0/modules/media/"
All the rest does not matter, I can have WP Total Cache enable, can have images inside Description, etc..etc..... :)

So for everyone using WordPress like me, to push RSS Feed you have to do the steps below:

Insert in your functions.php file the code:
PHP:
// function to insert xmlns:media in RSS Header
add_filter( 'rss2_ns', 'flipboard_namespace' );
function flipboard_namespace() {
    echo 'xmlns:media="http://purl.org/rss/1.0/modules/media/"';
}
// END

// function to insert Post Thumbnail inside RSS Feed
add_action('rss2_item', 'add_my_rss_node');
function add_my_rss_node() {
    global $post;
    if(has_post_thumbnail($post->ID)):
        $thumbnail = wp_get_attachment_thumb_url(get_post_thumbnail_id($post->ID));
        echo("<media:content>{$thumbnail}</media:content>");
    endif;
}
// END

and then you can use inside MailWizz the code below to show your image:
HTML:
<a href="[XML_FEED_ITEM_LINK]">
<img src="[XML_FEED_ITEM_IMAGE]" width="100" height="100"/>
</a>

Thanks @twisted1919 for all your help!! :)
 
Back
Top