• Hi,
    I use mailchimp to broadcast a newsletter (rss-driven campaign) and I have this RSS tags in the template:

    *|RSSITEMS:|*
    *|RSSITEM:TITLE|*
    *|RSSITEM:CONTENT|* read more...
    Leave a Comment
    Spread the Voice: *|SHARE:Twitter,Digg,Delicious|**|FACEBOOK:LIKE|*
    *|END:RSSITEMS|*

    I added some code in functions.php to insert the post thumbnail in the Rss Feed Page, and I can grab the thumb in the e-mail with the same tag RSSITEM:CONTENT. So I didn’t change anything in the E-mail Template.

    Now I need to grab 3 simple text custom fields I have in my posts.
    https://www.screencast.com/users/JuriT/folders/Jing/media/57a80784-c4e0-452f-94e1-4fa774f648a2
    Do you think I need to add some code again to edit the RSS Feed Page in WordPress and show them? And after that can I import them in the e-mail?

    Thanks

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

    (@jumust)

    Hi,
    I added this code in the function.php

    function wpbeginnerb_postrss($content) {
    global $wp_query;
    $postid = $wp_query->post->ID;
    $address = get_post_meta($postid, 'address', true);
    if(is_feed()) {
    if($address !== '') {
    $content = '<br /><span style="margin-top:0px; margin-left:164px; font-size:12px; font-family: Tahoma bold; color: #000000;">'.$address .'</span><br />'.$content ;
    }
    else {
    $content = $content;
    }
    }
    return $content;
    }
    add_filter('the_excerpt_rss', 'wpbeginnerb_postrss');
    add_filter('the_content_feed', 'wpbeginnerb_postrss');

    I found it here https://www.wpbeginner.com/wp-tutorials/how-to-add-content-and-completely-manipulate-your-wordpress-rss-feeds/ in the section “Add a Custom Field to your WordPress RSS Footer” but I edited it to not show in the footer but somewhere before the content (I added style in the span tag). Here is my sample email template: E-mail

    Now I’m wondering if I can move the custom field above the Title and not above the Content, should I change $content with $title….

    Thanks so much

Viewing 1 replies (of 1 total)
  • The topic ‘RSS to E-mail , Custom Fields?’ is closed to new replies.