';
}
/**
* Get the Post Thumbnail URL for the EXIF link
*/
function autofocus_exif_link( $post_id = NULL, $size = 'full-post-thumbnail', $attr = '' ) {
global $id;
$post_id = ( NULL === $post_id ) ? $id : $post_id;
$post_thumbnail_id = get_post_thumbnail_id( $post_id );
$size = apply_filters( 'full-post-thumbnail', $size );
if ( $post_thumbnail_id ) {
$thumburl = get_attachment_link( $post_thumbnail_id, $size, false, $attr );
} else {
$thumburl = '';
}
return $thumburl;
}
/**
* Add Images/Video/Embeds to feeds
*
* - Based on the Custom Fields for Feeds Plugin by Justin Tadlock:
* - http://justintadlock.com/archives/2008/01/27/custom-fields-for-feeds-wordpress-plugin
*/
function autofocus_feed_content( $content ) {
global $post, $id;
$blog_key = substr( md5( get_home_url('url') ), 0, 16 );
if ( !is_feed() ) return $content;
// If there's no video is there an image thumbnail?
if ( has_post_thumbnail() ) {
$mediafeed = the_post_thumbnail('medium');
}
// If there's a video or an image, display the media with the content
if ($mediafeed !== '') {
$content = '
' . $mediafeed . '
' . $content;
return $content;
// If there's no media, just display the content
} else {
$content = $content;
return $content;
}
}
add_filter('the_content', 'autofocus_feed_content');
?>