RSS Feed – Thumbnail URL as image tag
-
Hello!
I am trying to assign the thumbnail URL from a WP post, to an image tag inside my rss feed. But im doing something wrong and dont know what, maybe somebody of you can tell me why!
I am using this code inside my themes functinos.php
function ThumbRSS() { global $post; if ( has_post_thumbnail( $post->ID ) ) { $image_id = get_post_thumbnail_id($post->ID); $image_url = wp_get_attachment_image_src($image_id,'large'); $image_url = $image_url[0]; $image_url = '<image>'.$image_url.'</image>'; } return $image_url; } add_filter('rss_item', 'ThumbRSS');
thanks for any help on this!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘RSS Feed – Thumbnail URL as image tag’ is closed to new replies.