b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Advanced Topics
  3. How to...
  4. Show images in my RSS when option "Post excerpts" is selected

Show images in my RSS when option "Post excerpts" is selected

By default, when you set the RSS mode of your blog as Post excerpts RSS/Atom Feeds, and due the post excerpts are composed exclusively with text, your images will not be linked in the final XML file. In order to include your images set as teaser, you will need to make a little code customization as following:

Locate the file /blogs/skins/_rss2/index.main.php and look for this line


$content = $Item->get_excerpt();

Note: If you are using version 5.0.6, and have not touched this file before, it should be the line number 127.

Replace that line with this code:


// Display images that are linked to this post:
$content = $Item->get_images( array(
		'before' =>              '<div>',
		'before_image' =>        '<div>',
		'before_image_legend' => '<div><i>',
		'after_image_legend' =>  '</i></div>',
		'after_image' =>         '</div>',
		'after' =>               '</div>',
		'image_size' =>          $image_size,
		'restrict_to_image_position' => 'teaser' //this line defines which image types will be included in the output
	), 'htmlbody' );

$content .= $Item->get_excerpt();

After that, your RSS output will look like in the image:

Created by mgsolipa • Last edit by fplanque on 2020-06-09 00:25 • •

No feedback yet

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
  • Operations Reference
  • Advanced Topics
    • Using Desktop Blogging Tools
    • Using Blogging Apps
    • Blogging by email
    • Using the APIs
    • Contributing
    • Translations (i18n/l10n)
    • Monetizing
    • How to...
      • How to create your own flag / locale
      • How to post by MMS
      • Make a Backup
      • How to use UTF-8
      • Use RSS
      • How to set up Google Analytics
      • How to compare backups
      • Publish an XML Site Map
      • Show images in my RSS when option "Post excerpts" is selected
      • Include an image rollover in a post
      • FTP 101: How to upload and manage files on your web server
    • Podcasting
  • Glossary
  • Archives
Bootstrap back-end

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque