Added an if/else statment for post/pages.