Within the loop, you can do it this way, outside of the loop, pass the post ID to get_post_type
function. :
// Within the loop
$cpt = get_post_type_object(get_post_type());
if($cpt !== NULL)
{
echo $cpt->name;
echo $cpt->description;
}
If you need to see more about get_post_type_object
you can find it in codex.
Related Posts:
- Template for specific post of custom post type
- How do I display two separate taxonomy archives for two post types that share a single taxonomy?
- Page is defaulting to archive page and not designated template
- Custom Post Type Archive URL takes over page URL
- is_singular won’t call my functions?
- How do I create new content pages for my Custom Post Type?
- where can I see my custom post type archive template?
- Disable single pages and archives and keep preview
- Need post_type_archive_title function but in ‘single’
- Custom template page with custom archives listing by user
- Create template for taxonomy results limited by Custom Post Type
- How can I get this request to use the Custom Post Type page template instead?
- Archive for a Taxonomy of a Custom Post type
- how to remove pages loading with the archive templates
- How can I use archive-{post_type}.php theme template?
- How do I find a way to create a global single.php for a custom post type?
- How to use single.php for creating, reading and editing Custom Posts with ACF
- Custom Post Type setup
- Can’t access private custom posttype single- or archives-page
- Archive Template being used instead of Category Template for Custom Post Type
- Function to allow single post template based on custom taxonomy?
- How can I allow users to edit text that will be displayed on a custom post type archive page?
- Conflict in function to allow single post template based on category
- Turning archive templates to a page template maintaining the slug
- Assign for all post of a post type a specific single-post template
- Custom Post Type tag taxonomy “Page Not Found”
- DIVs not showing correctly on CPT?
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- How to make a list of posts displaying them 5 by 5 with a “next posts” link?
- is_singular won’t call my functions?
- how to pass args for archive.php query?
- Can I assign a template to a custom post type?
- Permalink Structure for Multiple Post Type Archives by Taxonomy
- Taxonomy, Terms, and Template Files
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- Setting up custom post type archives in WP3.1? Any luck?
- Using Templates with Custom Post Type UI
- How to show more posts on an archive page?
- Pre get posts for single post
- Pull Two Posts Into Custom Post Type `single-cpt.php`
- is_singular() not working if called via callback function of admin-ajax.php
- Custom Post Type Archives by Date (stored as meta value) WP3.1
- Custom templates for posts like for pages: page-{id} vs single-{id}
- Posts in Multiple Columns and Rows with one single loop
- Removing CPT slug from URL results in 404 error for archive page
- Multiple post types in archives (filter?)
- How to let custom post type posts show in standard post archive (like in homepage)?
- Display different gutenberg template from selected post attributes
- Custom post type archive sorted and grouped by date in post meta field
- Displaying Meta Box Image
- Trying to manage templates on a blog with lots of custom taxonomies
- How to get current post id of a custom post type in a loop using template singel-{custom type}.php?
- Pagination Issue: Custom Post Type In Index
- Create second custom 404 page for selected post type
- Custom-post-type-archive: posts sorted/filtered by year?
- How to call custom single post?
- Remove single page for custom post type
- Root slug of taxonomy returning 404
- Custom post type content using custom fields without template
- Custom post type posts don’t show in archive widget
- Including all post id’s of a custom post type into an array
- Set templates for custom post types
- Problems with 404, .htaccess, permalinks and WordPress custom posts locally on Snow Leopard
- Main query not querying any posts in custom taxonomy template
- Return the name of the post type
- archive as a page, so that it can be added in the wp_menu_nav
- Which file/template is in charge of taxonomies for custom post types?
- adding custom post type “name” to single template
- Dynamic category name in query post
- Custom Post Type Archive Pagination
- How can I increase the post count for custom post types only?
- Is possible register two archive pages for single custom post type?
- Custom Post Type Archive Page showing as 404
- Add custom template ‘sub-page’ to Custom Post type?
- Load info from customposttype into template page
- custom post template design with dropdown option
- Custom post type single page uses the right template in preview mode but shows a different template after being posted
- Post Attribute Section missing for Custom post type
- How to assign post to category
- Custom taxonomy with custom post type template not showing
- Values show up in custom home page but not in custom post pages
- Single Page of Custom Post Type Not Showing the Content Of post
- Organising custom taxonomies and custom post types
- Include template if a post is a single product
- Custom nav menu current item custom link problem
- How to decouple custom post types components from template?
- How to Fix Custom WordPress Loop with Pagination on Single Post View?
- Show Templates in Custom Post Type Editor
- Parent to another Custom Post Type – Template files not being recognized
- Stop Custom post type from being searched via URL
- How to avoid hardcoded text in a custom page template?
- archive-{custom_post_type}.php not getting recognized wordpress
- Display results from two Custom Post Types in page template
- Using custom post types within a section of a template
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Pagination not working for archive
- Problem retrieving custom field for a custom post type
- Only One Post of Custom Post Type Appearing on Template Page
- Choose custom post type template by category
- using a template for more then 1 page