It will work only if the filter is a bu attribute for the category, it will not work, so you need to write, for example
echo $_filter->getType(); if($_filter->getType()=='catalog/layer_filter_attribute') { echo $_filter->getAttributeModel()->getAttributeCode(); }
source share