Function for wordpress to allow sorting posts by term name