Skip to content

Instantly share code, notes, and snippets.

@benthebear
Created July 25, 2013 13:32
Show Gist options
  • Save benthebear/6079667 to your computer and use it in GitHub Desktop.
Save benthebear/6079667 to your computer and use it in GitHub Desktop.
/*
Plugin Name: Teaserimage
Plugin URI:
Description: Allows to insert Teaserimages in your Theme
Author: Benjamin Birkenhake
Version: 0.1
Author URI: http://birkenhake.org
*/
add_filter( "the_content_feed", "teaserimage_addto_feed" );
/**
* @param $content Content of post
* @return string
*/
function teaserimage_addto_feed($content){
if(has_post_thumbnail()){
$content = '<p>'.get_the_post_thumbnail(get_the_ID(), array(300, 300)).'</p>'."\n".$content;
}
return $content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment