Wordpress code refactored into a single loop and more partials