add_filter( 'the_content', 'hidden_image_before_content' ); function hidden_image_before_content( $content ){ global $post; if ( is_singular('post') && has_post_thumbnail() ){ $content = preg_replace( "/<p>/", '<p class="hide">' . get_the_post_thumbnail($post->ID, 'full') . '</p><p>', $content, 1 ); } return $content; }
Leave a Reply