This is the 60th in a series of live lessons on using WordPress and Thesis as a Content Management System (CMS) for a Community Library Website. In this lesson we create the link on the Review that takes us to the original Catalog Item. We use get_post_meta to get the catalog item post id and then use get_permalink to create the link.
Okay so anyway, we’re at custom functions php here and we put this stuff all the way down at the bottom. And so, we added this information to the review heading and now we want to place the link from the… or place the link to the catalog item from the review.
So we’re just going to copy this and modify it slightly. This place is a link to the catalog item on the review and link to catalog item.
And so if… now, it’s not going to be catalog items in this case. It’s if review because this is the question of what kind of post type is it? It’s the review post type so if review = get post type then review link id… we’re going to call it catalog link id = get post meta and what did I save that as? Oh it’s catalog item link id. So if review is essentially this. So catalog item link id = get post meta… catalog item link id and then it’s echo get the permalink for catalog item link id. What text would you like on that? It’s obviously not going to be “Read our recent review”. Maybe “Go to the catalog page for this book.”
Yes or return to item description or see item description. Something like that.
Okay. “See full item description.”
Yes, that’s good.
Okay and then we need to change the name of the attachment here so instead of byob link to review, it’s byob link to catalog item. And this should now create the link from the review to the catalog item. So let’s test it and see. Gosh, I hate to make mistakes like that. Oh my golly, can’t believe it. Where I am I? I am at library. That’s what I’m looking for. And then we’ll go to content, themes, thesis_18 and then custom and the custom functions php and refresh this. And there is the “See full item description” which takes you that “Read our recent review”, takes you back.
That looks good.