Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

list 20 posts of type “palvelut”

list 20 posts of type “palvelut”

// WP_Query arguments
$args = array (
	'post_type'              => 'palvelu',
	'posts_per_page'         => '20',
	'order'                  => 'DESC',
);

// The Query
$queryn2 = new WP_Query( $args );

// The Loop
if ( $queryn2->have_posts() ) {
	while ( $queryn2->have_posts() ) {
		$queryn2->the_post();
		// do something
	}
} else {
	// no posts found
}

// Restore original Post Data
wp_reset_postdata();