I'm doing a custom gallery for a portfolio page in a website and It works well if I simply use the URL of the media uploaded this way :
SELECT * FROM wp_posts AS p INNER JOIN wp_postmeta AS m ON p.ID=m.post_id WHERE p.post_type='attachment' AND m.meta_key='_wp_attached_file'
The thing is, if I upload too many big files, the page gets sloooow. This is why I'd like to use thumbnail but I have no idea how to select them accordingly in the database.
They're created in the wp-content/uploads folder, but I can't see which
meta_key to select in the database.
Also noticable, my databse doesn't have any
"_thumbnail_id" in the
Anyone has an answer ?