Wordpress post image attachment slug

Hello there,

I am trying to use CSV Importer plugin for wordpress to bring in my posts by the masses of an online store of mine.

Each product has two images…the template is setup to have image_thumb as the featured image and then pull in whatever images are under Upload/Media/Gallery (aka attached images to the post, not inserted in the actual content). However I can’t figure out the slug for the .csv file that I’m importing to get the image that is not image_thumb attached to the post so it shows correctly. Basically I just call in the entire URL under image_thumb and that works great…now it’s a matter of adding multiple images.

Got any ideas?

Thanks,
Lorne
Coming Soon | ActiveState Designs

PS-I’ve added my .csv if it helps

You’d probably want to do a little macro in excel to move the different fields into cells… but if instead of opening the CSV file directly (by double clicking) you import it, excel would do it for you and that would be easier to read.

The only image that you have there is the one included as an image image_thumb:

http://activestatedesigns.com/wp-content/uploads/TEE-I-CO-Ski02_Design.jpg

Hello there,

Yes thanks for the suggestion. I am using excel. I just attached the .csv for reference.

Also for the CSV I have included all the headers that successfully import and create a post. I have tried so many different options it’s ridiculous. from image_thumb1, image_thumb2, post-image, post_content, image, IMAGE, etc. The list goes on, but nothing works!

Do you have any ideas?

These images are the ones I’m trying to attach:
http://activestatedesigns.com/wp-content/uploads/TEE-I-CO-Ski02_Design.jpg
http://activestatedesigns.com/wp-content/uploads/TEE-I-CO-Ski02.jpg

thanks in advance,
Lorne

You have the exported file and the second image is not listed there.

That could be because the information related to those images is in another table and not in the main one which is the one you exported. Therefore you don’t have the data for that image nor the information about which post it is related to.

Some plugins do create their own tables (something that I quite like, keeping things separate) and some others don’t, simply add more text in specific fields.

WP installs 11 tables by default. If you have more tables, maybe one of those keeps that information your seeking.

Molona,

Thanks for responding. I think I am doing a bad job explaining. The .csv file I attached is the file I am using to IMPORT not export. The plugin CSV Importer only imports posts. I do not need to specify which post because this .csv is the post itself. I am creating a whole new post with this import. I have an online store I am trying to create new products in and need to mass import a lot of products with 2 images per post via csv. The csv is only one post for testing purposes. To add more posts I add more content on the next row.

The .csv I attached I am aware does not have the second image in there. I have reattached the .csv file and the execel file for your reference. The image_thumb category works great for attaching the featured image. The next two columns: IMAGE, IMAGE are not working. I was trying to make those images and attachments under upload/images/gallery to the post.

Make sense?

Thanks,
Lorne

Maybe I’m bad at understanding.

First, why do you have to fields with the same name? Are you always going to have one or two images associated with one item or is it possible that you have more? because then it may be a good idea to save that info in some other table.

Second, have you look into your loop function to make sure that your php code is aware of the changes you’re doing to the wp_posts table?

Hi Molona,

Well I have two fields as the same name because I cannot figure out what the correct title should be so those titles are placeholders until I figure out what the correct name should be.

I will typically only have 2 images per product. So basically I will upload those images ahead of time a mass import of tons of images, then my csv file being imported will basically create new posts for products and call in the correct image files from my media library which are already uploaded.

I am confused what you guys are talking about tables? Separate tables? I also don’t know how to look at my loop function? I’m pretty new with all this.

Thanks,
Lorne

Lorne: Did you have any luck with this? I was trying to do the same and had no luck with it.

Hello Slideaway,

I half figured it out. I have figured out how to import custom taxonomies and the featured image.

For custom taxonomies you must use the title heading: csv_ctax_TAXONOMYNAME

For adding a featured image you must have the title heading: image_thumb and include the full URL to the already uploaded image in wordpress. It’s important you upload the image prior to importing the csv for that to work.

I say ‘half’ figured out because my product posts require more than one image per product. So just having the featured image working only gets me one image, but I am still tryign to figure out the correct heading for more attached images to the posts.

Does anyone know how I can find the correct slug for attached images to the post? Refer to the screenshot of wordpress to see what I am speaking of specifically.

Any help is much appreciated! Molona I appreciate the help thus far :slight_smile:

Slideaway if you figure this out, please share!

Thanks,
Lorne

Does anyone know how to find the title of this slug?

I know I’m going to look stupid but… which slug? what do you mean?

No, you don’t look stupid, I am probably calling it the wrong thing.

There are two images attached. The first shows the add media dialog, the second shows the same dialog with the gallery images attached to the post in wordpress. They are not inserted in the body of the post, but attached to it, and my theme template calls in those images to display them.

You can see the theme if it helps: Product at ActiveState Designs.

Basically when there’s more than one image attached to the post smaller thumbnails appear below the main image and the visitor can enlarge the thumbs.

In my CSV file I have a header above each column that calls in each specific item for the post. I have ALL of them working except for the column: post_img. I’ve attached that test file too.

Any ideas?

Thanks,
Lorne

When you say that it is not working… what exactly do you mean? that you can’t import/export them correctly?

By not working I mean, when I import my CSV file, the information under post_img doesn’t come into the post. So it needs to be the correct header in the excel .csv in order to import the post with attached images.

Does that make sense?

Thanks,
Lorne