This is the fifteenth in a series of live lessons on using WordPress and Thesis as a Content Management System (CMS). We are using the CSV Importer plugin to import an existing database from a CSV file. We have decided to import images using this method as well. In this lesson we add the images to the website and then configure the data so the plugin can import it.
Okay so now we’re going to do Part 15 of the Community Library Website case study and this morning what we’re going to do is we are going to finalize our data import and we’re doing something that we haven’t talked about before which is we are going to add images to this automatic import. And so, Pamela or Pam has given me a new csv list and has also given me some images.
And so the first thing we’re going to do is upload those images to our site. Now what I’ve done… this is my local hard drive, my local machine and on this, I have a folder for this project called library. And inside of WordPress, I have my downloads folder and a WP content folder. And then inside of WP content, I have plugins and themes. So what I’ve done here is also create a new folder called book-images. Now the name is important because in the first place, it shouldn’t conflict with anything else out there and second place, it needs to… it can’t have any spaces. You couldn’t name it book images or anything like that. It’s got to be a good name for a… HTML name. So I called it book-images and then inside of that, we have all of these images for these different books.
Okay so then…and then what I’ve done is in Filezilla, I have synchronized what I have in my local machine with what we have on the website. And so, you can see I uploaded that folder called book images, with all the images up to the website here inside of WP content. And so, what we need to do now is sanitize a bit or make the address work properly for those images. So here is her… these are her post images here. And so, what we’re going to do is… and this is the name of each image but we need to add the rest of the address to it. So what we’re going to do is insert a row and then in this row, we are going to create a new row and that will be the other half of the address. So http://www.library.byobtutorial.com/… And then remember that was inside wp-content? And then inside of that was book-images and then slash. Okay so that’s the rest of the address.
So what we’re going to do now is we’re just going to copy this all the way down. Okay and then we will come back up to the top and we’ll join these 2 together. We’ll create a new row or column, I mean, and this will be equals and that will be equal that and then the ampersand… not dollar sign, ampersand. And then this..so now we have created that whole thing. You can see, here’s the new image or the new address. So we’ll go ahead and scroll back down here with this again. Okay come back up here to the top and then what we’re going to do is we’re going to copy and then we’ll paste values.
Okay so there we go. Now we’ve got our values and you may notice that there are a couple of these in here without… let’s see. Yeah, I think like this one for example. It doesn’t have an image and so, it’s going to produce an incomplete address. So what we’ll do is we’ll just go through and delete those. You could you know, create an if then statement in this equation here you know, if this has value then add that to it. Otherwise, leave it blank but that’s stretching my skill set so I’m going to leave that people who know that better. I thought I saw… there’s a couple more. And then let’s just kind of slowly go back up through it… okay, I think that’s got it. So now we can take this and delete it and this and delete it. Let’s see, delete it… there we go. That’s what I meant to do and delete it. And now, we have the new address here.
Now the only other thing we need to do is give it the correct title. Now what we’re doing here is we are taking this content and we are putting it inside of the Thesis post meta called Thesis post image. And so, you remember that if we don’t put csv in front of the top of this title, what that means is it’s going to become post meta. And so, we already have a… Thesis already established this post meta called Thesis post image and so that’s what we want. We want all of this stuff imported and when it gets imported, we want it imported and placed in Thesis post image post meta. That will mean that all of the adjustments that we can make in Design Options will apply to this image. And so, it’s just as if you put the image in yourself the hard way.
Okay well, so now we’re going to move on to finalizing the data and importing it.