Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9108551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:50:06+00:00 2026-06-17T02:50:06+00:00

I am using a WordPress RSS to use in my iOS project. The feed

  • 0

I am using a WordPress RSS to use in my iOS project. The feed doesn’t have thumbnail links in it, so I searched and found this code to add thumbnail links to feed.

/* include thumbnail in RSS feed */
function add_thumb_to_RSS($content) {
   global $post;
   if ( has_post_thumbnail( $post->ID ) ){
      $content = '' . get_the_post_thumbnail( $post->ID, 'thumbnail' ) . '' . $content;
   }
   return $content;
}
add_filter('the_excerpt_rss', 'add_thumb_to_RSS');
add_filter('the_content_feed', 'add_thumb_to_RSS')

This code adds the image link in feed, but it adds as html code in the beginning of description tag like this:

<description>
<![CDATA[
<img width="150" height="150" src="http://www.ipadia.co/wp-content/uploads/2012/02/sayfada-bul-150x150.png" class="attachment-thumbnail wp-post-image" alt="sayfada bul" title="sayfada bul" />Some text some text Some text some text Some text some text Some text some text Some text some text Some text some text ....
]]>
</description>

I want to add image link with another tag like <image> or <thumb> the link </thumb>. So I can parse this more easily.

How can I do this? Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:50:07+00:00Added an answer on June 17, 2026 at 2:50 am

    I solved it finally 🙂 I changed the function that I posted before. The new function is this:

    add_action('rss2_item', function(){
      global $post;
    
      $output = '';
      $thumbnail_ID = get_post_thumbnail_id( $post->ID );
      $thumbnail = wp_get_attachment_image_src($thumbnail_ID, 'thumbnail');
      $output .= '<post-thumbnail>';
        $output .= '<url>'. $thumbnail[0] .'</url>';
        $output .= '<width>'. $thumbnail[1] .'</width>';
        $output .= '<height>'. $thumbnail[2] .'</height>';
        $output .= '</post-thumbnail>';
    
      echo $output;
    });
    

    This gives the image link in new tag <post-thumbnail> like I wanted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working with Wordpress on this. I'm using Magpie to grab an RSS feed, but
I need to display 2 different feeds rss with Wordpress. I'm using this code:
The code below is part of an rss feed parser using WordPress's simplepie fetch_feed()...
I'm trying to load a wordpress RSS feed using simplexml_load_file and failing. I have
I have been using this plugin for few days. http://wordpress.org/extend/plugins/simple-rss-feeds-widget/ This is the plugin
Im using Wordpress, Im also creating posts via XMLRPC based on an RSS feed
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
WordPress RSS feed not work when custom filed have '&'. i think that may
I use jQuery jFeed plugin to fetch rss feed from WordPress blog and show
I am using this plugin http://wordpress.org/extend/plugins/simple-rss-feeds-widget/ This works fine for me. i am using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.