Show all categories from URL in archives page?
I want my archives page to list the categories based on the URL. For example, if the URL is domain.com/category/red+blue+green, I would like it to say “Your Selections: Red, Blue, Green” at the top of the page.
This is the code I have tried, but it only lists the first category and not all of them.
<?php $cat = get_category_by_path(get_query_var('category_name'),true); $current = $cat->cat_ID; $current_name = $cat->cat_name; echo "Your Selections: " .$current_name; ?>
If anyone can tell me how to get it to list them all, it would be greatly appreciated!
- The topic ‘Show all categories from URL in archives page?’ is closed to new replies.