How to Find the First image In WordPress Post or Page
You need to add icons to your search results, archives or simply to enable the Facebook Open Graph protocol on your blog site. This task can be accomplished by extracting the URL of the first image, used in post. If you follow certain conventions, this can always be the post or page thumbnail. I have seen many solutions to this relatively simple problem. Unfortunately most of them are incorrect. Here is the right PHP code to get the first image URL from the post content. Read the rest of this entry »
