I'm putting simple breadcrumbs in a site, based on a custom post's category.
Items > Category > Individual Post
"Items" doesn't change, it's just plain text.
In the Category page it's title is coded like this.
$term = $wp_query->queried_object;
$cat_title = $term->name;
An Individual post can have more than one category so I need to keep a track of which category the user clicked through to get to a detail page.
What's the best way to pass $cat_title and it's slug (to make the URL) to a detail page?
In the case where a user does a search and goes directly to a detail page, I assume I can check if this title is set, if not then I pull the first category it belongs to.