Add Images to the plugin
-
OK, I have added image support to the plugin for an image in an enclosure.
Here is the relevant code:
// test get the enclosure if ( $enclosure = $item->get_enclosure(0) ) { $enclosure_link = $enclosure->get_link(); if ( preg_match("/\.(png|jpg|gif)$/", $enclosure_link) ) { $flist .= "<img src='".$enclosure_link."' />"; } }
And you just add it before this existing code
// writes the link $flist .= "<a target='$target' href='$permalink'"; ...
And you’ll get your image. Use CSS styling to format it.
I use WP RSS Images plugin to add images to the WordPress feed in the first place. Here is an example of this plugin working on my site to show the recent articles with an image.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Add Images to the plugin’ is closed to new replies.