-
-
Save anonymous/03ba7b750ca618f353c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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