We have been building a community news CMS site in our Live Question and Answer sessions. This member is offering some additional refinements he’d like to see in the case study website.
Currently the site we have constructed has a separate “posts” page that displays all of the custom posts for a given community. Now he would like to see the custom post types be displayed by category as well. In the future we will discuss how to display each community’s posts organized in their individual categories.
Case Study Part 1- Community News Site, Custom Taxonomy vs Custom Post Types
Case Study Part 2 – Community News Site, Setting Up the Test Site
Case Study Part 3 – Convert Posts to Custom Post Types
Case Study Part 4 – Configure Permalinks for Custom Post Types
Case Study Part 5 – Install and Configure Thesis
Case Study Part 6 – Listing Custom Post Types on the Appropriate Page
Case Study Part 7 – Community News Site Future Refinements
Case Study Part 8 – Add Thesis Meta to Custom Post Types
Case Study Part 9 – Display Custom Post Types by Category
Case Study Part 10 – Create Category Display Order
Community News Case Study – Part 11 – Add Event Information as Custom Post Meta to Events
Community News Case Study – Part 12 – Create a Page with a Custom Loop to Display the Events Sorted by Date
Community News Case Study – Part 13 – Display Event Date on Teasers
Community News Case Study – Part 14 – Show Only Upcoming Events
Community News Case Study – Part 15 – Format the Display of the Date
Community News Case Study – Part 16 – Display Event Venue
Rick: So Douglas, is that all the functionality you want or is there more to it than that that you want to accomplish?
Douglas: I think if we get started, that would be great. I guess as I think about moving forward, it might be that let’s see… for instance, how hard would it be to… you see, I’ve got one contributor who’s putting things in 3 times a day and somebody else is putting in something else once a week but you want to be able to bring up who is coming once a week on the page. It’s not going to get pushed off so quickly. So could you organize the… what’s appearing by category so that at least you know, you have sorted in categories, something in each category is appearing in the post tab.
Rick: Absolutely. It’s absolutely possible and relatively easy to do that. And so why don’t we have that be the next… what we do next time? So what we’ve done here is we’ve given you a list of all the posts and next time what we’ll do is we’ll add an iteration on to that and we’ll have say, one column for cherries, one column for apples, one column for bananas.
Douglas: Excellent. Yeah, that’s what I was talking about.
Rick: And so then we’ll display the posts under those categories for that municipality or for that community.
Douglas: Okay and then where these boxes are there… indented with small boxes…
Douglas: Are those pictures associated with the post?
Rick: Yeah I lost something in translation when I moved the data over so for example, the Edmonds News post, if you look at Rainier Sweet Cherry, you can see that it does not have… oh, it does. It does have a post image associated with it.
Douglas: You speak of the thumbnail there of some sort?
Rick: Okay, so we’ll do that. That’s why those images aren’t showing up though because there’s a disconnect between this image and what Thesis thinks this thing can have since it’s not a post.
Rick: Yeah. As soon as we resolve that, this little thing will go away and the image that it’s supposed to have will show up.
Douglas: The coding for the… that you showed us there, would it be possible for you to put that someplace where I could find it?
Rick: Absolutely. In fact, this moment, I will add this to the forum but when the videos are posted, the code will also be posted with the video. So… but we go over to the forum, let’s see… forum. And I think I put it under General Thesis Questions. Oops. Or maybe I’ll just search for it. Let’s see, Live Answer code, here it is. And so this is some code I used earlier today in another question. I’m just going to post another one here. Here is the code for the Custom Loops for the Custom Post Type. Paste that, let’s see. For whatever reason, every time I paste in here, it duplicates the code. Back up to there and then format it as php, save it. Okay so you can just you know, cut this code out of here now by selecting that, right? View raw code.
Douglas: Yeah, great.
Rick: And… but I will… when we post the video, I will also post the code with it.
Douglas: Thanks so much. That’s wonderful.
Rick: And you know, this case study has a potential for lasting a few weeks so as you want… see, it builds on stuff I want to teach here, right? Stuff I plan on teaching and so, this is a great opportunity for me to work on that and to give people sort of a preview of what’s coming up in the future. So to the extent that you want to clarify this beyond where we’re going to go next time, you know, please feel free to ask…to have the code more directly tweaked to the condition you’re working in. Because, I’m happy to do that as part of this case study process. I think there’ll be a lot of people who will find value in this.
Douglas: Yes, yes.
Rick: Okay. Well, great.