i created a custom post type called 30 day boot camp using this code:
add_action( 'init', 'rt_custom_post' );
function rt_custom_post() {
register_post_type( '30-day-boot-camp',
array(
'labels' => array(
'name' => __( 'Boot Camps' ),
'singular_name' => __( 'Boot Camp' ),
'add_new' => _x('Add New', 'Boot Camp'),
'add_new_item' => __("Add New Boot Camp"),
'edit_item' => __("Edit Boot Camp"),
'new_item' => __("New Boot Camp"),
'view_item' => __("View Boot Camp"),
'search_items' => __("Search in Boot Camps"),
'not_found' => __('No Boot Camp'),
'not_found_in_trash' => __('No Boot Camp found in Trash')
),
'public' => true,
'has_archive' => true,
'menu_icon' => 'dashicons-calendar-alt',
'supports' => array('title','editor','thumbnail','author'),
)
);
}
When i am on the archive page (archive-30-day-boot-camp.php) i can pull the name for the boot camp by this code:
<?php if ( is_post_type_archive( '30-day-boot-camp' ) ) : ?>
<h1 class="h-landmark entry-title"><span>
<?php post_type_archive_title(); ?></span></h1>
<?php endif?>
and it returns "boot camps"
However when i go to a single entry on my (single-30-day-boot-camp.php) i can't understand how to return the custom post type name. I want it to return "boot camps" Not just the post title itself. (which could for instance be "day 1".)
i tried:
<?php post_type_archive_title(''); ?>
but nothing shows up
i also tried
<?php post_type_archive_title('30-day-boot-camp'); ?>