Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

My WordPress site includes the full article in its RSS feed. This includes the text of the post and basic formatting. It also includes post images and their captions.

The problem is that my captions are not formatted. They appear below my images, but they look like plain text. This makes it hard for a reader to see that they are associated with the preceding image.

How can I change the formatting of the image captions in an RSS feed reader? I'd like to make the captions italic or to use a gray color to distinguish it from the other text.

share|improve this question
add comment

3 Answers

As far as I know the only way to add styles to RSS feed items is by adding them inline (e.g. <p style="color: #333; font-weight: bold;">Hello World</p>). If you don't specify any styling, then the reader app/website that the end-user is using applies its default styles.

Certainly editing styles.css won't make any difference, because that files only styles your website, not the RSS feed.

So the only way I can think of would be to add a filter to the_content, check if it's a feed using the is_feed conditional, then use regular expressions to add styles inline.

share|improve this answer
    
Thanks, Simon. Your answer led me to this article about customizing RSS feeds: codex.wordpress.org/Customizing_Feeds. It's too bad that there's no way to do this apart from making changes to the RSS templates. –  dthrasher Mar 1 '11 at 1:56
add comment

Have you tried adding:

.wp-caption {
   (your styles)
}

to style.php?

share|improve this answer
    
Where is style.php? It's not one of the templates I can see in my WordPress editor. Is this a file I have to edit on the server? Or did you mean style.css? –  dthrasher Feb 25 '11 at 3:01
add comment

It is the file style.css. You can use the classes left, right and center to avoid text beside the image. Because images a normally defined as inline.

share|improve this answer
    
As @Simon Blackburn pointed out, changing style.css only helps for the html pages served up by WordPress. It's not going to help style me style the RSS feed in Google Reader. –  dthrasher Mar 1 '11 at 1:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.