[Plugin: WordPress Related Posts] Support Intext Images
-
Hi,
after installation I made an update to your code.
If no thumbnail is attached or defined it tries to parse an image included using an “img” tagfunction wp_rp_get_post_thumbnail_img($related_post) { //... $postContent = $related_post->post_content; if (preg_match('/.*<img.+src=["]([^"]+)["].*/i', $postContent, $imgMatch)) { $img = '<img src="'. $imgMatch[1] . '" alt="' . esc_attr(wptexturize($related_post->post_title)) . '" />'; return $img; } //... }
It would be nice if you add this to your code.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: WordPress Related Posts] Support Intext Images’ is closed to new replies.