Show parent categories of the current category
Another way to go about it instead of substring, would be to use implode/explode & array filter. echo implode(” » “, array_filter( explode(” » “, get_category_parents( $cat, true, ” » “) ) ) ); Breaking that down: Start with your original string. $string = get_category_parents( $cat, true, ” » “); Explode the string using your … Read more