Forums
Home / Plugin: Contextual Related Posts / Single Quotes in Thumbnail
(@p3hndrx)
8 years, 2 months ago
Greetings— I am generating thumbnails based on the first image in the post. The image URLs contain some special characters that are stripped.
How can I pass the literal string: <img src="my_url_with_special_chars" />?
<img src="my_url_with_special_chars" />
I think this works…: preg_match_all( '<img.+src=[\'"]([^"]+)[\'"].*>', $post_content, $matches );
preg_match_all( '<img.+src=[\'"]([^"]+)[\'"].*>', $post_content, $matches );
Under media.php
Thumbnails need to be generated…
(@ajay)
Can you show me an example of this?