wordpress get posts get all posts code example
Example: get all posts
$args = array(
'numberposts' => 10,
'post_type' => 'book'
);
$latest_books = get_posts( $args );
$args = array(
'numberposts' => 10,
'post_type' => 'book'
);
$latest_books = get_posts( $args );