Build Your Own Business Website header image

Community Library – Part 23 – Remove Custom Post Meta from Post Display

Difficulty Level -

Whoops, you've found some premium content!

Watch the opening clip of this video to preview it,
the full video is available to paid members.

This is the twenty third in a series of live lessons on using WordPress and Thesis as a Content Management System (CMS). In this lesson we take 4 custom post meta elements that we added to our post display in part 21 and remove them from the normal post display. We are adding “location”, “call number”, “ISBN” and “Publication Date” to the display of our custom post type and we are adding language that makes it apply to the custom post type only.

Community Library Website – Case Study Part 1 – Site Organization
Community Library Website – Case Study Part 2 – Create Custom Post Types
Community Library Website – Case Study Part 3 – Custom Post Type Configuration
Community Library Website – Case Study Part 4 – Custom Taxonomy Decisions – Theory
Community Library Website – Case Study Part 5 – Custom Taxonomy Decisions – Practical Application
Community Library Website – Case Study Part 6 – Incorporating Existing Data Into the Project
Community Library Website – Case Study Part 7 – Creating Hierarchical Custom Taxonomies
Community Library Website – Case Study Part 8 – Creating Non-Hierarchical Custom Taxonomies
Community Library Website – Case Study Part 9 – Creating Custom Post Meta
Community Library Website Case Study – Part 10a – Restore the Database Using BackupBuddy
Community Library Website Case Study- Part 10 – Creating Custom Post Meta – Continued
Community Library Website – Part 11 – Importing Existing Data to the Website
Community Library Website – Part 12 – Prepare Existing Data for import by the CSV Importer plugin
Community Library Website – Part 13 – Import Existing Data Using the CSV Importer Plugin
Community Library Website – Case Study Part 14 – Date in Permalink Configuration
Community Library Website – Part 15 – Importing Images
Community Library Website – Part 16b – Final Data Import
Community Library Website – Part 17 – Add Thesis Post Meta to Custom Post Type
Community Library Website – Part 18 – Add WordPress 3.0 Menus
Community Library Website – Part 19 – Add Post Meta and Taxonomy Information to the Post Display
Community Library – Part 20 – Add topics and audience to book display
Community Library – Part 21 – Display the Rest of the Post Meta in the Post
Community Library Website – Part 22, Create the Permalink Structure
Community Library – Part 23 – Remove Custom Post Meta from Post Display
Community Library Website – Part 24, Add Taxonomy and Post Meta Data to the Teaser
Community Library Website – Part 25, Add Taxonomy Data to the Teaser
Community Library Website – Part 26, Adjust the Teaser Styling Using Design Options
Community Library Website – Part 27, Styling the Teaser Using CSS
Community Library Website – Part 28 – Fine Tune the Teaser Display
Community Library Website – Part 29, Designing a Custom Catalog Page
Community Library Website – Part 30, Using a Query String in a URL
Community Library Website – Part 31, Adding Custom WordPress Menus
Community Library Website – Part 32, Add Custom Menus to the Catalog Page
Community Library Website – Part 33, Add Another Custom Menu to the Catalog Page
Community Library Website – Part 34, Troubleshooting Custom Menus
Community Library Website – Part 35, Add Styling to WordPress Menus
Community Library Website – Part 36, Add HTML Markup to WordPress Menus
Community Library Website – Part 37, Add WordPress Menus to Archive Pages
Community Library Website – Part 38, Add and Style a List of Tags
Community Library Website – Part 39, Add a Search Box to the Sidebar
Community Library Website – Part 40, Add Links to the Sidebar
Community Library Website – Part 41, Add Taxonomy Drill Down Browsing
Community Library Website – Part 42, Custom Loop to Display Custom Post Types
Community Library Website – Part 43, Simple Custom Query
Community Library Website – Part 44, Custom Taxonomy Query
Community Library Website – Part 45, Add Thesis HTML Structure to Teasers
Community Library Website – Part 46, Display Posts from the Last 60 Days
Community Library Website – Part 47, Custom Loop If Have Posts
Community Library Case Study – Part 48, Increase the Number of Posts that Display on the Custom Catalog
Community Library Website – Part 49 – Naming Conflicts in Custom Taxonomies
Community Library Website – Part 50 – Find and Replace Semi-colons in the Database
Community Library Website – Part 51 – Modify Taxonomy Names Directly in the Database
Community Library Website – Part 52 – Sort Posts by Meta Value
Community Library Website – Part 53 – Show the Term Label Only when a Term Exists
Community Library Website – Part 54 – Sort Archive Posts by Meta Value
Community Library Website – Part 55 – Add Sort Order to Custom Taxonomy

Video Transcript

So then the next thing we’re going to do here is we’re going to fix my little problem on this post. Notice again, if you select this post I created, it’s got listed under topics and audience and can be found in and call number and ISBN and publication date. We don’t want that stuff to be added to this.

So we got to go back to our custom php file and if we scroll down here, this is the one that added the subtitle and the author name to the post heading. And so, what we’ll do here is we’re going to complicate this query a bit by saying if is single and if the post type = catalog items.

Now I just answered a question like this on the DIY Themes forum here earlier and unfortunately, there is no conditional tag that is equivalent of if is single. So what we have to do here instead is we’re going to add a thing called get post type and we’re going to say and let’s see, catalog items. Okay and catalog items equals and then it’s going to be… I think it’s get post type.

So what we’re doing here is we’re asking if it’s a single post and essentially, if the post type = catalog items then add this to it. We need to make sure I guess, that that is exactly the right name for our post type. Catalog items, yes, okay… hyphen catalog items. Let’s just double check my get post type for a second here. Yup, it is. Get post type… oh, I need to put the current post in there though.

So the way we do that, I forgot about that. Global post and so, this is where we’re going to use that post id again, control copy. We’re going to put that right there equals get post type post id. So this is our current post id. And let’s just… you know, it’s not going to show up well for this because we don’t have any standard HTML that’s being output there if there’s no content. So let’s try this also on the one below which is where we put… oh no, this is it. Yeah, that subtitle. Topic tags and audience taxonomy, if is single. Okay, we could paste that there and I guess, we paste it here too because it really exists in all 3 of these places, doesn’t it?

Let’s see what happens. Let’s hope it doesn’t just crash the site. Okay, we upgraded that, we upload this, we come back over here… okay well, it didn’t crash. Okay, that worked. So if we come back over to one of our catalog items just to make sure that works… yeah, it still works. We’ve got our subtitle and our author and our stuff at the bottom. So, that was a solution that works.

0 Comments… add one

Save $200 on Membership Now!

Start learning today for as little as
$0.82 PER DAY!
THIS IS A LIMITED TIME OFFER!
Subscription Options
0 comments… add one

Leave a Comment