So actually, I already got this thing written out so I’m just going to copy it, open it up here and paste it. Now, I want to say that I am in the process of finishing up a plugin that will automatically do this. So if you’re watching this video and you don’t want to mess around with this code, that’s fine. Because in the next few days, I’ll be releasing a plugin that’s called Shopp Connect with Thesis that will take care of this for you. But if you want to use your own code, I wanted to show you how this works.
And if you have looked at other of my videos about how to add Thesis post meta to custom post types, this is going to look very familiar. But it does have a slight difference and that difference here is that it says if the class exists, Thesis post options. That is it checks first to see if the Thesis post options class actually exists. Now the reason for that is that for some reason or another, when you use the function… when you use this little function here for insert a product or a category for Shopp, when you use this little function… if we don’t have that test, that gets broken. So we have this test first to make sure that the class exists and then we have this typical code that I’ve shown you on other occasions where you go grab… you create a new set of Thesis post options. You grab all of the Thesis post meta boxes and then for each Thesis meta box, you cycle through and add those meta boxes to the custom post type. And the custom post type, in this case, is called shopp_product.
Okay and the way we do that here is to only add the meta boxes that we want. And really, I think the easiest way to do that is just to test for the meta box. And if it’s the right metabox then add it. Again, I’ve got this code written over here. So we’ll just reformat here for a second.
Okay so if we save that and upload it and come back and refresh this again, we’re going to see that the… now we only have our two meta boxes. Okay so we’ve got SEO details and additional style and our multimedia box but we don’t have the rest.
Okay so this is going to add a couple of… those couple of files to this page. So we save that and we upload it and we come back over here and we refresh it. And then if you scroll down here, it’s going to look right. See? I mean, it almost looks right. I mean, we can start typing… let’s see, what is this product? Dress shoe so dress shoes for men and women… let’s see, stylish dress shoes for men and women. You can see that we… it’s counting up here so we get to the 70 characters or whatever and then thesisshopp.com. Let’s just say that. Okay and then here’s some meta description. Okay you can see again it has counted for us here so we have that stuff saved.
I think while we’re at it, we may as well just show what it looks like here for adding the custom multimedia box code. And I’m just going to add a little bit of text here. This is text in the multimedia box. Okay so we have a little paragraph here and we save product.
Now if we go view this product, now you can see the name of this is stylish dress shoes for men and women. And if we actually… if we come and take a look at the page source… let’s just do it that way. View page source, the title is stylish dress shoes for men and women, thesisshopp.com. The description is “Here’s some meta description.” That’s what I put in there rather than what it was before. And then of course, now we’ve got this multimedia box text here. Now if we come back over to shoes, you see that multimedia box test isn’t there. And if we look at running shoe… actually, it’s not going to be there so it’s only showing up where we want it to show up, that is showing up in the multimedia box for this one page.