Added conditional to check if post is published in sidebar before outputting