custom function for checking, if post is in selected category