hybrid
8/5/2018 - 11:57 AM

WP Query Loop

<?php
$args = array(
	'post_type'              => array('post_type'),
	'posts_per_page'         => '5',
);

$query_name = new WP_Query( $args );
?>

<?php if ( $query_name->have_posts() ) { ?>
	<?php while ( $query_name->have_posts() ) { ?>
		<?php $query_name->the_post(); ?>
		<!-- Loop -->
	<?php } ?>
<?php } else { ?>
	<!-- Not found -->
<?php } ?>

<?php
wp_reset_postdata();
?>