Aligning Images In RSS Feeds

When inserting an image into a post, WordPress lets you choose an alignment (left/right/center/none) and even add a caption. This usually works well when viewing the post on the blog itself, but will often look messed-up in the RSS feed. Basically, the image becomes unaligned and breaks the intended post layout. I’ve found an easy way to fix it.

As it turns out, the problem appeared when WP developers chose to remove the deprecated “align” attribute from the WordPress-generated <img> tags. Now, following web standards is all well and good, but what if you still want to align an image in a way that works in the feed, too? The typical answer is to add a style="float:left;" (or “float:right;”) attribute to each aligned image. However, that would become very bothersome if you had to manually edit the HTML code every time.

So I created a plugin that will do it automatically.

Plugin Description

“Align RSS Images” is a simple plugin that scans your RSS feed and ensures that every image has the correct alignment and margin settings. Technically speaking, it finds HTML elements styled with any of the WordPress-generated classes and appends an appropriate style attribute to each element. This is done dynamically when the feed is generated, so your actual posts won’t be modified.

Left-aligned picture in a RSS feed

Sidenote : Yes, I know that using styles in a RSS feed isn’t exactly standards-compliant either. Nevertheless, it works fine with Google Reader and the W3C Feed Validator says the feed is OK. So most likely the sky won’t fall on your head if you use this plugin ;)

Download

align-rss-images.zip (2 KB)

Requirements : WordPress 2.6 or later
Installation : Just upload and activate. The plugin is completely automated, but due to caching you may need to wait a few hours for the changes to appear in your RSS reader.

Related posts :

97 Responses to “Aligning Images In RSS Feeds”

  1. Martijn says:

    Hi,

    I installed your plugin 24 hours ago, but I still see no changes to the RSS Feed. Do you have any idea?
    I made other changes to the feed (removing the RSS footer) and this is gone now, so the feed is updated. But the images are still not aligned with teh text.
    Can you give me some help or advice?

    Thanks

  2. White Shadow says:

    I suspect this might have something to do with the fact that you’re using thumbnails instead of the full images in the feed. Most likely, the thumbnails have no alignment set, so the plugin ignores them.

  3. simon says:

    Is there anyway to use thumbnails in the RSS and have them float left?

  4. [...] wpisach, które nie są ich ikonami. Ikony wpisów są przez tę wtyczkę ignorowane (tak twierdzi autor wtyczki). Próbował ktoś to poprawić? [...]

  5. [...] Zainstalować wtyczkę Align RSS Images. [...]

  6. [...] Плагин обрабатывает новости непосредственно при выдаче. Он ищет все стили оформления, связанные с картинками, используемыми в публикации, и добавляет их к элементам прямо в HTML код новости фида RSS. Проще говоря, если вы уберете плагин, то и оформление фидов тоже уберется. Работа плагина наглядно видна на скриншоте выше. Скачать Align RSS Images [...]

  7. Plugin stopped working a while ago. It worked great for a year or two, but I suspect something broke with one of the WP 3.X.X upgrades.

    Deactivated :(

  8. Jānis Elsts says:

    Strange, it still works fine on my 3.3.1 and 3.4-alpha sites. Could you provide a few specific examples where it doesn’t work?

  9. [...] wpisach, które nie są ich ikonami. Ikony wpisów są przez tę wtyczkę ignorowane (tak twierdzi autor wtyczki). Próbował ktoś to poprawić? [...]

  10. [...] have images that look great on the original blog post but are misaligned in the feed. I use the Align RSS Images plugin to take care of that issue on the BlogAid [...]

  11. [...] that works on your RSS feed (this is where subscribers can read your blog). What I like about Align RSS Images is that it keeps the image formatting used on your blog post in the RSS feed, as opposed to losing [...]

  12. Sue Surdam says:

    I have been using and loving your plugin for a couple of years now. Just recently, I upgraded to Outlook 2012 and now all the styling benefits are gone. I just checked the actual RSS feed and the email RSS update in Gmail and the styling looks great. Any thoughts on what is going on with Outlook?

  13. Jānis Elsts says:

    I don’t use Outlook myself, so I can’t really provide much insight. Still, I would guess that Outlook changed the way it handles inline CSS styles in RSS feeds. You could try checking the settings to see if there’s an option to “Enable CSS in feeds” or something like that.

  14. Sue Surdam says:

    Thanks for pointing me in the right direction, the problem is in the CSS with Outlook 2007 and 2010 which both provide very limited CSS.

    “One of the more critical conversions that you should be aware of is that Outlook 2007 and 2010 will often move your CSS from div’s and headings into nested paragraph and spans. Sometimes, it keeps the outer container, other times it eliminates it entirely.

    One work-around is to avoid padding in block element containers and use margins instead.”

    from CSSPadding in Outlook 2007 and 2010 article, emailonacid.com

    Since center align images seem to work ok, I guess I will be sticking with them for now.

  15. [...] that your site visitors experience. The good news is that you can easily fix this problem with the Align RSS Images plugin. Read on to see how this plugin [...]

  16. yaplog says:

    So, I am not going to be able to participate this time around. So I need to be taken off the list for this time

Leave a Reply