Assuming you start with:
$custom_query_args = array(
'cat' => 10,
'post_per_page' => 5
);
$custom_query = new WP_Query($custom_query_args);
Then to answer your first question, you can see what is returned (for development/debugging) via:
var_dump( $custom_query );
To output your query as a normal loop, you simply need to call a custom loop, using the have_posts()
and the_post()
member functions of the Query class:
// Start loop
if ( $custom_query->have_posts() ) : while ( $custom_query->have_posts() ) : $custom_query->the_post();
// Loop output goes here
// End loop
endwhile; endif;
// Restore $post data to the default query
wp_reset_postdata();