Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

IDEA-HACK(Works WP Query)

// WP_Query arguments
$args = array(
	'post_type'              => array( 'works' ),
	'post_status'            => array( 'publish' ),
	'nopaging'               => true,
	'order'                  => 'DESC',
	'orderby'                => 'id',
);

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

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

// Restore original Post Data
wp_reset_postdata();