In this session, we describe how to recreate a similar function to what we just created with a different post type.
Rick: Okay so…
Reese: One question I do have. As we’ve discussed so far on the telephone, not in the class, right now I have the 3 custom post types. I have US Constitution, citations, and court cases. The way I understand that Verve Meta Box works, I cannot have the same field names for any of those three custom post types.
Rick: Oh sure you could. You could have the same field names for those. Why not?
Reese: Well, it wouldn’t let me.
Rick: Well, it wouldn’t let you in… what you would do is… I mean, what you could do is the same… you could use exactly the same meta box for all 3.
Reese: Yeah, well the difference is… you’re right. What I would need to do though for instance, on the citations, some of the citations are going to have external links. Court cases will never have external links. US Constitution will never have external links so they’ve got all the constitution stuff in there.
Rick: Well so then you just create different custom post meta for each one.
Reese: Yeah but then I can’t use these same names.
Rick: You can’t use the same…
Reese: Like shortcodes, for the code name?
Rick: Yeah, you’ll have to change the names in this, in the… I mean, really, you want to either do them all the same or you do want to them all different.
Reese: Right, right. I was trying to use the shortcode… all of them are going to have a shortcode but it wouldn’t let me use the same shortcode in the 3 different boxes.
Rick: And what you’re really talking about there is the same post meta name. It won’t let you create post meta… 2 kinds of post meta that have the same name.
Reese: Correct. Now…
Rick: Which is no big deal because all you have to do is change the post meta name in the function.
Reese: Right, right. And then on the citations where some of them refer to Google Scholar, then instead of going and getting the internal URL…
Rick: You’re going to have to save that URL as a piece of custom post meta.
Reese: Right. And then I would just refer to that custom post meta and go from there.
Rick: Exactly. Because you’re still using all the same kinds of data, right? So you’ve got a full reference, a short reference, some citation information…
Reese: If I’ve got a reference citation, it would be an external link.
Reese: I would have a post meta called external link, maybe just have…
Rick: Yeah. But you’d get the post meta exactly like getting the post meta here. You’d still use the case ID. All you’d do is just a different field.
Rick: So my suggestion would be that you take stab at it and if it doesn’t work right then we take it up again.
Reese: As crazy as it sounds, I understand that it’s very clear. It’s very straightforward. It’s just step by step so what I need to do now is just for myself, standardize the way I do the field names, standardize the way I do the function stuff and then just start populating my court cases.
Rick: Yeah and the way I would do this is you know, gti case long or full, gti case short, gti citation full, gti citation short, gti constitution long. You know… I mean, I would definitely standardize around stuff like that.
Reese: Right… which is very easy to do, okay.
Rick: So the mistake you were making that we talked about privately was that you were placing HTML in and repeating that HTML in 2 different places.
Reese: Yeah and I see that now and it’s totally unnecessary. That would be a great time saver, not having to horse around with that.
Rick: Plus it would cut out opportunites for error. If you cannot capture HTML, if you can go ahead and let the HTML be written by the code…
Reese: Yeah you see, what happens, you have these different reporters, legal reporters that are published at different times. And back in 1925, there are 3 or 4 Supreme Court reporters that weren’t a gleam in everybody’s eye. And so as I’m progressing through the years, I’m finding where cases are being picked up by different reporters. So then all I have to do is go into that case, add that reporter and now it updates it across the 300 court cases that might potentially reference that document. So this is going to really improve the accuracy and really improve my having to edit these cases. Because having to… like, “Oh my gosh, I just hope when I cut and pasted it, I didn’t leave off a period or a letter or something like that or screw up the name.” When you’re working on it at 5 o 6 in the morning, you’re still kind of bleary-eyed or at midnight or 1 o’clock at night, you’re still kind of bleary-eyed.
Rick: Tell me about it.
Reese: You of all people would feel my pain. So the thing that is… I mean, the takeaway from this whole process is that you have this very… you have a nice system for entering the data only one time and letting the code do what it does best.
Rick: Right. Now how much of a performance hit do I take when a court case is pulled up and it refers to 6 cases?
Reese: Well, you take a… I mean, probably not with 6 cases, you take a performance hit, right? I mean, because… you know, I don’t know if you’ve ever done this but if you go to my Video Lessons page here you know, you’ll notice that this Video Lessons page loads slowly. It loads slowly because it’s got many loops. And so it has you know, 1, 2, 3, 4, and then each one of these things is a loop. So 5, 6, 7, 8, 9, 10, 11. I mean, it’s just got lots and lots of loops. And….
Reese: Even then, it’s quick.
Rick: And even then, it’s relatively quick because WordPress is really good at loops.
Reese: Okay, well I think…
Rick: But this is probably the slowest page on my site because it has the most amount of data. This page actually has to loop through every single video on my site – every post, every page. Everything on my site it’s got to be looped through and printed out in one way or another on this page. And so… and at this point, that’s over 1000. It’s a fairly… I mean, it’s a quick process.
Reese: Yeah, it’s not a trivial page by any stretch.
Rick: Yeah, this page. So this page is… I mean, I just showed that to you so that you can see that… I mean really, I probably have 100 loops on this page. So when you add 6 loops to your page, it’s probably not that big a deal.
Reese: Well then the next thing that I’ll probably want to check with you as I get a little further along is doing the print stylesheets.
Rick: Well, I’m not actually prepared to talk about that but I want to be.
Reese: No, no. I’ve got… I need to worry about finishing getting these cases loaded before I start worrying about making them pretty.
Reese: But I have some things I think I’m going to get here in the next month or two. I think I’m going to see a lot more traffic so I’ll try to get it further along.
Rick: Well, let’s just plan on touching bases on it again here. You know, we can even come back at it next Wednesday night if we need to.
Reese: I think I’m good. I mean, this is really pretty straightforward. There’s not anything exotic, weird, illegal or fattening. It’s just straightforward. Okay, anything else I need to do or…
Rick: I don’t think so.
Reese: I think that takes care of my Rick file. That does take care of your Reese file?
Rick: Well, I haven’t looked lately. We’ll have to see.