I spent the weekend working off-and-on on my final project. When I sat down for my first intended work session, I felt immediately overwhelmed. I’ve never taken on a project like this one before. There were too many apps to be aware of: GitHub, MAMP, FileZilla, a tab of local WordPress testing, and a tab of the live site. Not to mention tab after tab of “how do I…” queries.
But as I spent more time on this project, I noticed more and more similarities with the work that I’m used to doing. For one thing, you can’t do it all in one sitting; you have to get up and move, to do something else, walk away and return. For another, there won’t just be one unfinished project; there will be many unfinished sections—the same way you move on to another paragraph when writing, even when you know you’ll have to come back later to tighten the language, add more context, or reassess the flow.
I’ve made some progress, but it was slow and buggy. I was elated to see that I have two functioning custom post types appearing on my life WordPress site. Then, I was immensely frustrated when I couldn’t figure out how to display those post types. I started working on my custom CSS as well, but didn’t get too far with it, because I thought I needed to add more content before I could really decide what properties I wanted certain classes and IDs to display. Back and forth, back and forth.
I’m coming to class with a lot of questions. But at least having questions means I’ve made some progress. Here are a few:
- I copied the custom post type code from the Reading List example, but I can’t figure out how to add more than one meta box. When I tried simply duplicating the code, I threw an error on my test site: “invalid post type.” Undo, undo. Save. Walk away.
- I have two custom post types built into my live site now (yay!): one for event posts, and another for job posts. I was hoping I would be able to use CSS to differentiate these posts visually, but when I refreshed my site, I couldn’t even figure out how to display these different posts! Research, research. Over my head. Save. Walk away.
- I also have some wish list items that I imagine would be relatively do-able, but won’t focus on too much because I’m not sure they’re feasible with our timeline. But I’ll ask here, anyway: I would love a feature that would connect the data from my “event date” meta box to a calendar widget elsewhere on the site. That way, each event would appear both as an independent post, and as part of a collective calendar. Is this possible? And how hard would it be?
So many questions…
– For the custom meta box, do you need a second custom metabox on the same post type? If not, I’d just add more fields to one meta box. (Also, just to check, is each custom post type created a separate plugin? Doing so might also help deconflict things in the code.)
– You have a few options (in no particular order) for making different post type look different from each other:
1) create a custom template for each post type
2) create a custom format to go with each post type and set each post type to default to it
3) add logic to the template to check what post type it is
Whichever way you choose, you’d add a class to the related template and then apply the styles using CSS.
– Can you please share more details about the calendar (e.g. which service and how did you implement it on your site)? In general, I’d say that would probably be too ambitious to add on top of everything else before the deadline. A great post-semester project though!