Switch to $post_type variable already created. Closes #661