Wordpress - How do I add the featured image to the_content after the first paragraph?
You can do this using the 'the_content' filter:
add_filter( 'the_content', 'insert_featured_image', 20 );
function insert_featured_image( $content ) {
$content = preg_replace( "/<\/p>/", "</p>" . get_the_post_thumbnail($post->ID, 'post-single'), $content, 1 );
return $content;
}
Of course, you can add options to the the_post_thumbnail() function to define which size of thumbnail you'd like to use, etc... http://codex.wordpress.org/Function_Reference/the_post_thumbnail