sort posts by dates

function to sort posts by dates
add a space between @location, :category