axxe16
2/9/2017 - 9:02 AM

Ciclo base di wp query con custom post

Ciclo base di wp query con custom post

<?php 
$query = new WP_Query( array( 'post_type' => 'prodotti' ) );

// Il Loop
while ( $query->have_posts() ) : $query->the_post();
	echo '<li>' . get_the_title() . '</li>';
endwhile;

// Ripristina Query & Post Data originali
wp_reset_query();
wp_reset_postdata();