removal of taxonomy checks (get_post_meta used instead), $post->ID replaced with get_the_id() in main query