Forums

re-formatting captions for RSS feed only (1 post)

  1. eightchbomb
    Member
    Posted 7 months ago #

    I have my RSS feeds up and running (expressnightout.com/feed) as desired except 1. the captions look like the rest of the text; 2. except they are too wide when viewed in a reader.

    Here's an example of the image/caption code as it appears live (both on regular posts and in the RSS feed):

    <div id="attachment_36442" class="wp-caption aligncenter" style="width: 580px"><img class="size-full wp-image-36442" title="Maron" src="http://www.expressnightout.com/wp-content/uploads/2011/10/Maron.jpg" alt="" width="570" height="380" /><p class="wp-caption-text">Marc Maron broadcasts the “WTF” podcast out of his garage studio, affectionately dubbed the Cat Ranch, in Los Angeles.</p></div>

    The reason it's too wide (I think?) is that the the width is designated inline, so the RSS obeys.

    And I believe I can style the RSS feed captions — I just want to make them smaller and bolder than the rest of the text — by adding inline tags.

    Right now, I'm not filtering the_content for the feed. It works exactly as I want, except for the captions.

    from feed-rss2.php:

    <?php if ( strlen( $post->post_content ) > 0 ) : ?>
    <description><![CDATA[<?php the_content() ?>]]></description>

    My guess is that I need to create or modify a filter that will remove the width inline style and add the caption inline styles.

    I can't figure out where to begin. Or perhaps there is another way?

    Thank you all for your time!

Reply

You must log in to post.

About this Topic

Tags