refactored code to check wordpress conditionals
added views for single post