$args = array( 'post_type' => 'post', 'category_name' => 'news', 'posts_per_page' => 10 ); $query = new WP_Query($args); if($query->have_posts()) { while($query->have_posts()) { $query->the_post(); // display post content here } }In the above code example, WP_Query is used to retrieve 10 posts in the category "news". The have_posts function is then used to determine if there are any posts to display. If there are, the while loop is used to display the content of the posts. Based on the inclusion of "WP_Query" and "have_posts", this code example uses the WordPress core library.