I'm working on a wordpress project that involves getting ~990 entries from a spreadsheet into the system. I've been able to create CSV files to create the posts, as well as their associations with a handful of custom taxonomies. Now however I have to figure out this media thing.
990 posts, almost all of which need to have an image and a video file associated with them.
I've tried a plugin for importing csv data into the database, and in wp_postmeta creating entries with the associated Post ID, a meta key of "_wp_attached_file", and the file name. I also added entries for each image into the posts table, including what SHOULD be the right guid, post_parent, and post_mime_type.
The theme I have in place can pull the data as it needs to and display as it should, but behind the scenes is where the problem lies. I go to edit a post and unless it's one where I manually added the media through editing the post itself, no image shows up. There's SOME association I must be missing in the database somewhere, but I haven't been able to track it down yet. There has to be a way to handle this through SQL, as opposed to manually editing every entry.
I'm looking at _wp_attachment_metadata, and I'm wondering if that's the key? Are the entries in wp_postmeta and wp_posts really essentially pointless, and it's all on _wp_attachment_metadata? I'd hate to set out on hacking together 990 (video too, so 1980) serialized entries only to find out that's still not the missing link.
I have the images in wp_posts with the proper parent, and in postmeta with the right information. Something is still missing though...