Advertisement
Guest User

Add Image to Image tags

a guest
Jul 31st, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1. // Add the image node to RSS feed
  2. function add_rss_node_image() {
  3.     global $post;
  4.     if(has_post_thumbnail($post->ID)):
  5.         $thumbnail = get_attachment_link(get_post_thumbnail_id($post->ID));
  6.         echo "<image>{$thumbnail}</image>";
  7.     endif;
  8. }
  9.  
  10. add_action('rss2_item', 'add_rss_node_image');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement