1

The goal is to display a featured thumbnail micro thumb as a custom field in RSS.

This is what I've done:

    //theme functions.php
function rss_post_thumbnail($content) {
    global $post;
    add_post_meta($post->ID, 'little_thumb', get_the_post_thumbnail($post->ID,  'thumbnail'), 1);
    return $content;
}
add_filter('the_excerpt_rss', 'rss_post_thumbnail');
add_filter('the_content_feed', 'rss_post_thumbnail');

    //feed rss2.php
<item>
    <little_thumb><?php echo get_post_meta(get_the_ID(), 'little_thumb', true); ?></little_thumb>
</item>

But, I can't seem to retrieve this value with the parses. If I open RSS source code though, I can see this thumb right there.

Any ideas?

I'm using a really lightweight lastRSS.php class, if it matters.

0

Do'h! I'm really dumb. It was the problem of parser, it's choosy about retrieving fields. I had to manually add it into an array of allowed values in my parser.

  • 2
    Could you please post your whole code? Currently the answer doesn't help anyone later on. Thanks – kaiser Oct 3 '12 at 12:36
  • An explanation on how you got this to work would be the real answer. – russjman Mar 9 '15 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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