The next thing I want to do in this process of displaying testimonials in Thesis 2.1 with custom post types and taxonomies is to add some additional information like Sammy Bright and his Website Name, Website URL and that sort of thing. This is called Custom Post Meta.
Use Types Plugin to Create Custom Fields
So again, using the Types plugin we’re going to create some custom fields. We’re going to start that by adding a custom fields group and the group title will be Testimonial Details. So under Testimonial Details, we can choose a bunch of different fields.
We are going to select the post type and this testimonial details is going to apply to testimonials so it won’t show up in any other post type. We won’t worry about terms or templates, and we won’t worry about Data-dependent display filters so it’s just going to show up on our testimonial edit page.
What we’re going to do then is first, we’re going to add a single line. And that single line will be testimonial name, and under the description I’m just going to say the name of the person giving the testimonial. We’re going to say required to make that required.
Then we’re going to add another single line and this single line is going to be Website Name and just like that, we’ll say testimonial-website-name and “Enter the website name”. We’re not going to make it required.
Then we’ll add a URL and this will be Website URL, and again we’ll say testimonial-website-url and then “Enter the website URL”. The we’re going to validate it making sure that the URL is a valid URL address so check that and save.
Edit Testimonials and Use New Custom Fields
Now, let’s come back over to testimonials again and edit Sammy’s testimonial. Let’s scroll down here to the bottom and we’ve got this new Meta box, Testimonial Details. I’m going to shift it up to the top.
Now we’re going to say, Sammy Bright. There’s our testimonial detail, the website name was www.sammybright.com, that’s what it’s going to display like. And then his URL will be back over here and notice what happens if we don’t do that, it says please enter a valid URL address. So it’s going to make sure it’s valid so http://sammybright.com and hit update.