• Resolved kahoferj

    (@kahoferj)


    Hi,

    I am creating a MailChimp newsletter by passing across my WordPress posts as RSS feeds. My posts contain images embedded within the text. With the help of your plugin, I am able to align images to the right or the left, with the text wrapped around them.

    I would like a 20px margin around each image. Styling in my CSS file seems to be ignored, so I attempted a function in functions.php to include this style rule inline:

    function rss_style_images ($content) {
    global $post;
    $rsscontent = ”;
    $rsscontent = str_replace(“<img”, “<img style=(margin:20px;)”, $content);
    return $rsscontent;
    }
    add_filter (‘the_content_feed’,’rss_style_images’);

    but still my images appear without margin in MailChimp.

    Can anyone tell me where I’m going wrong?

    Thanks.

    https://wordpress.org/plugins/align-rss-images/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter kahoferj

    (@kahoferj)

    Have fixed my own problem! I should have quotes, rather than brackets, around the margin:20px clause:

    function rss_style_images ($content) {
    global $post;
    $rsscontent = ”;
    $rsscontent = str_replace(“<img”, “<img style=\”margin-right:20px; margin-left:20px;\””, $content);
    return $rsscontent;
    }
    add_filter (‘the_content_feed’,’rss_style_images’);

    Thread Starter kahoferj

    (@kahoferj)

    Closing post.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Margins around images’ is closed to new replies.