simplified blog function to accept params
categories now use the function too