I don’t know if you have experienced this issue in your blog, although it really isn’t an issue, but for the lazy bloggers, oh well… Today I’m going to teach you or rather give you a solution. Some WordPress themes make use of featured image rather than the post’s first image and as a blogger, you may not always have the time to set up a featured image for your post or sometimes, you just feel too lazy to do what you are supposed to do. The code I’m about to give to you is a code I also use on my blog. It is really easy to implement. All you have to do is go to your template editor, select functions.php and in the box, paste the code below after other codes. function get_src() { if ( has_post_thumbnail() ) { $src = wp_get_attachment_image_src( get_post_thumbnail_id(), ‘thumb’ ); $fbimage = $src[0]; } else { global $post, $posts; $fbimage = ”; $output = preg_match_all(‘/<img. src=[\'”]([^\'”] )[...
Start a Blog, Share your Stories | Everything worth sharing can be blogged... It's your life, Live it Blog it!