Created
July 25, 2013 13:32
-
-
Save benthebear/6079667 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* | |
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