Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are 2 functions in wordpress that can help you in a very easy way, try this:</p> <pre><code>(int) $id = get_post_thumbnail_id($post-&gt;ID); $url = wp_get_attachment_url( $id ); </code></pre> <p>Edit:</p> <p>To modify the feed you can check <a href="http://codex.wordpress.org/Customizing_Feeds" rel="nofollow">this documentation</a></p> <p>One easy option is modifying directly the feed template, an example:</p> <p>in file wp-includes/feed-rss2.php (note you may modify another feed template as "feed-rss.php", "feed-atom.php") you can add the new tag:</p> <pre><code>echo '&lt;?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'&gt;'; ?&gt; &lt;rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" &lt;?php do_action('rss2_ns'); ?&gt; &gt; &lt;channel&gt; &lt;title&gt;&lt;?php bloginfo_rss('name'); wp_title_rss(); ?&gt;&lt;/title&gt; &lt;atom:link href="&lt;?php self_link(); ?&gt;" rel="self" type="application/rss+xml" /&gt; &lt;link&gt;&lt;?php bloginfo_rss('url') ?&gt;&lt;/link&gt; &lt;description&gt;&lt;?php bloginfo_rss("description") ?&gt;&lt;/description&gt; &lt;lastBuildDate&gt;&lt;?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?&gt;&lt;/lastBuildDate&gt; &lt;language&gt;&lt;?php bloginfo_rss( 'language' ); ?&gt;&lt;/language&gt; &lt;sy:updatePeriod&gt;&lt;?php echo apply_filters( 'rss_update_period', 'hourly' ); ?&gt;&lt;/sy:updatePeriod&gt; &lt;sy:updateFrequency&gt;&lt;?php echo apply_filters( 'rss_update_frequency', '1' ); ?&gt;&lt;/sy:updateFrequency&gt; &lt;?php do_action('rss2_head'); ?&gt; &lt;?php while( have_posts()) : the_post(); ?&gt; &lt;item&gt; &lt;title&gt;&lt;?php the_title_rss() ?&gt;&lt;/title&gt; &lt;link&gt;&lt;?php the_permalink_rss() ?&gt;&lt;/link&gt; &lt;comments&gt;&lt;?php comments_link_feed(); ?&gt;&lt;/comments&gt; &lt;pubDate&gt;&lt;?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?&gt;&lt;/pubDate&gt; &lt;dc:creator&gt;&lt;?php the_author() ?&gt;&lt;/dc:creator&gt; &lt;?php the_category_rss('rss2') ?&gt; &lt;?php //start modified code to add tag with post thumb url (int) $id = get_post_thumbnail_id($post-&gt;ID); $thumb_url = wp_get_attachment_url( $id ); ?&gt; &lt;thumb&gt;&lt;?php echo $thumb_url;?&gt;&lt;/thumb&gt; &lt;?php //end modified code to add tag with post thumb url ?&gt; &lt;guid isPermaLink="false"&gt;&lt;?php the_guid(); ?&gt;&lt;/guid&gt; &lt;?php if (get_option('rss_use_excerpt')) : ?&gt; &lt;description&gt;&lt;![CDATA[&lt;?php the_excerpt_rss() ?&gt;]]&gt;&lt;/description&gt; &lt;?php else : ?&gt; &lt;description&gt;&lt;![CDATA[&lt;?php the_excerpt_rss() ?&gt;]]&gt;&lt;/description&gt; &lt;?php if ( strlen( $post-&gt;post_content ) &gt; 0 ) : ?&gt; &lt;content:encoded&gt;&lt;![CDATA[&lt;?php the_content_feed('rss2') ?&gt;]]&gt;&lt;/content:encoded&gt; &lt;?php else : ?&gt; &lt;content:encoded&gt;&lt;![CDATA[&lt;?php the_excerpt_rss() ?&gt;]]&gt;&lt;/content:encoded&gt; &lt;?php endif; ?&gt; &lt;?php endif; ?&gt; &lt;wfw:commentRss&gt;&lt;?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?&gt;&lt;/wfw:commentRss&gt; &lt;slash:comments&gt;&lt;?php echo get_comments_number(); ?&gt;&lt;/slash:comments&gt; &lt;?php rss_enclosure(); ?&gt; &lt;?php do_action('rss2_item'); ?&gt; &lt;/item&gt; &lt;?php endwhile; ?&gt; &lt;/channel&gt; &lt;/rss&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload