I created a project portfolio using the Portfolio custom post type built into Pro. I used the layout builder to get the look I want on the project category pages and single portfolio item pages. The goal was for it to be easy for the client to add new projects and it was working great until they changed their mind.
Here’s an example of an existing category page the way we set it up. As you can see, this shows all their grocery store client projects.
They now want the category page to show only one item from each client project. For those that have multiple projects, they want those to link to a subcategory/archive page of all those projects. For those that have just one project they want it to link to the single for that project.
I’ve been racking my brain trying to figure out how to do this. Is there a way to use query string url parameter or segment with a fallback so that if there’s a subcategory it links to the subcategory and if there isn’t, it links to the project single?
I’ve already figured out how to have only one project on the category page by selecting only one portfolio item in the parent category and adding the rest to the subcategory. But I can’t figure out how to create the conditional url, if that is even possible.