This is the twenty fourth in a series of live lessons on using WordPress and Thesis as a Content Management System (CMS). In this lesson we add the custom post meta of subtitle and author’s name to the teaser. We previously added this information to the post. We accomplish this with Thesis hooks in custom_functions.php.
You know, it would be funny if this was labeled adult and up in the thing, it said books/adult for a church library. That would be good. But anyway, so the next thing we want to do then is we’re just going to style this. Well no, first thing we’re going to do is we’re going to add the additional data to the teaser. And so you can see the additional data here is going to be the subtitle and then it’s going to be the name and then we’ll have the non-fiction, we’ll have the location down here. We’re going to change the Read More.
So the first… so I guess the first thing we’ll do is we’ll just add stuff. Now this and this, we’ve… well actually, all 3 of these things we’ve added to the post view of this. And it’s pretty much the same thing except that we’re going to add it to the teaser and the teaser has a hook after you know, teaser header or something like that that we can hook into. The same thing is there’s another hook you know, after teaser that this can hook into. So it’s going to be fairly easy to add the additional data to it.
So if we go to our custom functions php file here for a moment and okay, topics and authors. We want to get the topics list and then we want to get… oh no, this was audience so we don’t… I wonder I why I said author there. List under topics and then audience, it wasn’t author, it was audience.
So back down to the next one, catalog data items and… okay, where on earth is my author list here? I must be missing it. Oh, it was up one more. That’s what it was. Author… so we need to get the terms for author and actually, what we really need is exactly this. And I think that we can probably simply… let’s see, shall we keep it that way? Yeah you know, I think we will.
And so what we’re really going to do is we’re not going to do anything special. We’re just going to add it again so I’ll grab this add action and it’s going to be not Thesis hook after headline but it’s going to be Thesis hook after teaser or something rather. Let’s go over to the DIY Themes for a second and check it out. Let’s see, User’s Guide. You know, I use this thing all day long. It’s really gotten to be a pretty powerful tool. Okay, hooks and Thesis hook after teaser headline. That’s it, okay. Thesis hook after teaser headline, let’s grab that and add it right here. Thesis hook after teaser headline, we can save that and open up Filezilla. And let’s see, library, content, themes, thesis_18, custom and custom functions php. Okay, let’s check it out.
Okay, that didn’t work. Okay did I… I saved it. Okay, global post. Oh no no, I see. It’s not going to work. It says if is single so that’s fine. We’re just going to have to… we’ll just copy this and do another one.
And let’s see, this is for the post so now we’ll come down to the teaser section. Okay, this function has a subtitle author name to the teaser. Teaser heading, let’s see… let’s go up and cut this piece out of here. Come back down to teaser heading again and byob teaser heading.
Okay and now it’s not going to be if is single. We are just going to… I think we’ll just get rid of this really. So it’s the subtitle equals the subtitle… yeah, I think it’s all we have to do. Let’s just save it and try that.
Yeah, there it is. So now we have our subtitle and our author name here.