WordPress.org

Support

Support » How-To and Troubleshooting » Best way to add <image> to my rss feed?

Best way to add <image> to my rss feed?

  • I see that in WordPress 2.0, do_action(‘rss2_head’) has been added to the header in wp-rss2.php.

    In WordPress 1.5, I added my own <image> tag right after <language>. But maybe in 2.0, I should make use of rss2_head? What is that, and how do I do it?

    [Edit] Sorry about the title. I didn’t know escaped characters wouldn’t be unescaped. Whoops.

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’de like also know the answer.

    You can add it directly to the file if you like, or you can create a separate function to add it using the rss2_head hook. The advantage of using the action hook is that your change will survive an upgrade of the wordpress software, whereas a direct change won’t.

    Just add something like this to your functions.php file (in your theme):


    function add_my_rss2_image()
    {
    echo '<image>http:whatever</image>';
    }
    add_action('rss2_head','add_my_rss2_image');

    What you want meen whit http:whatever ? Is the name of my website?

    The URL to your image.

    Yeah, it’s the URL to your image. If you don’t know what the <image> tag does in RSS, then you probably should not be doing this. Go learn more about RSS first.

    Ok, It’s not realy sommethig that I need. What I want was a way to show the images of my posts in rss feed.
    Thank you for the explanation.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Best way to add <image> to my rss feed?’ is closed to new replies.
Skip to toolbar