$pt = get_post_type_object( 'books' ); // These two usually contain the post type name in plural. // They may differ though. echo $pt->label; echo $pt->labels->name; // This one holds the post type name in singular. echo $pt->labels->singular_name;
$args = array( 'post_status' => 'publish', 'posts_per_page' => 5, ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); the_title(); the_excerpt(); endwhile;