Skip to content

Instantly share code, notes, and snippets.

Created May 25, 2013 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/03ba7b750ca618f353c1 to your computer and use it in GitHub Desktop.
Save anonymous/03ba7b750ca618f353c1 to your computer and use it in GitHub Desktop.
if ( get_option( 'woo_rss_thumb' ) == 'true' ) {
if ( get_option( 'rss_use_excerpt' ) )
add_filter( 'the_excerpt_rss', 'add_image_RSS' );
else
add_filter( 'the_content', 'add_image_RSS' );
}
function add_image_RSS( $content ) {
global $post, $id;
$blog_key = substr( md5( home_url( '/' ) ), 0, 16 );
if ( ! is_feed() ) return $content;
// Get the "image" from custom field
//$image = get_post_meta($post->ID, 'image', $single = true);
$image = woo_image( 'return=true&link=url' );
$image_width = '240';
// If there's an image, display the image with the content
if( $image != '' ) {
$content = '<p style="float:right; margin:0 0 10px 15px; width:' . esc_attr( $image_width ) . 'px;">
<img src="' . esc_url( $image ) . '" width="' . esc_attr( $image_width ) . '" />
</p>' . $content;
return $content;
} else {
// If there's not an image, just display the content
$content = $content;
return $content;
}
} // End add_image_RSS()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment