I have created a page template to display specific data. Is it a bad idea to copy the loop from page.php and paste it as is in the template file? Does this mess with the loop? Doing this has made my page just as I need it. I tried a custom query using WP_Query but that didn't want to work
I am using a custom query in a page template but it displays nothing. What am I missing?
$query = new WP_Query(); if( $query->have_posts()): while($query->have_posts()): $query->the_post(); get_template_part( 'template-parts/page/content', 'page' ); // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) : comments_template(); endif; endwhile; // End of the loop. endif;