I have a wordpress installation. What i'd like to do is call data directly from the wordpress tables in the database and display them on some other non-wordpress pages.
At the moment i'm successfully pulling in the three most recent posts from the wp_posts table. I can't however see in the schema where the post thumbnail (or featured image) are stored.
How can I get either the featured image, or thumbnail? (either will do!)
Thanks in advance!
There is a way to pick up thumbnail url with other post data in one select query.
You need to create special function onetime:
Then you can use it this way:
i hope that this solution will be useful for somebody.
Its all in you wp_postmeta table
will query the thumbnail ID of a certain post ID (you need to have your post IDs).
Imagine the returned thumb id is : 600
will give you two rows : meta_key="_wp_attached_file" will give url meta_key="_wp_attachment_metadata" will give meta info like size etc
Hope this helps better