fixes WP issues on virtual-pages-with-templates

includes #6, #7, #9, #10, #11 and #18 issues