When I execute
'<?php echo get_category_parents(get_query_var('cat'), false, '\' - \''); ?>'
on the category page bar
, which is a sub category of foo
, this is the output: 'foo' - 'bar' - ''
. How do I remove the last, empty category without PHP functions like explode
or substr
?