I used this piece of code in functions.php
to add featured image in <image>
tag in feed
add_action('rss2_item', 'add_my_rss_node');
function add_my_rss_node() {
global $post;
if(has_post_thumbnail($post->ID)):
$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'medium');
$url = $thumbnail[0];
echo("<image>{$url}</image>");
endif;
}
then the URL of featured image displayed in feed as I expected.
Now I want to pull this URL out, I tried <pre>$item->get_title()</pre>
but it didn't show anything.
Now I wonder how can I get this URL out?
this' my feed: http://techdaily.vn/feed and I follow this guide to use feed_fetch http://codex.wordpress.org/Function_Reference/fetch_feed