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.

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.

share|improve this question
add comment

1 Answer

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.

share|improve this answer
1  
Could you please post your whole code? Currently the answer doesn't help anyone later on. Thanks –  kaiser Oct 3 '12 at 12:36
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.