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?
- Archive for CPT
- Is it better to use filter for the_content in archive pages?
- Migrating a taxonomy’s tags to the native category
- Flush Rewrite Rules when new site is created on network
- WordPress custom taxonomy template not working
- Not Able To Render Single-CustomPostType.php File
- Custom post type posts don’t show in archive widget
- How to specify a template for a path like http://example.com/something?
- Custom templates for a specific category
- Single page not working for custom post type
- Custom post type pages return 404 page?
- single-{post_type}.php not working
- Get term name without a foreach loop
- Cant get paginations on single.php to work with my custom post types
- WordPress 3.9 not using custom template
- Including all post id’s of a custom post type into an array
- Archive not sorting correctly
- Template files for Custom Post Type and Taxonomy
- Set templates for custom post types
- How to Create Template File for Parent Page of Custom Post Type
- Problems with 404, .htaccess, permalinks and WordPress custom posts locally on Snow Leopard
- Custom post_type search pages
- What’s the name of the custom post type yearly archive template?
- Archieve.php not loading for custom post type
- multiple custom post type on category page
- Custom Post type & Taxonomy 404
- Main query not querying any posts in custom taxonomy template
- Custom Empty Results page for my Custom Post Type
- Associate page w/ specific single post template?
- Display custom post types in wp_list_pages
- Custom posts template page
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- List of users that clicked a ‘Join’ button at single post
- Taxonomy archive 404ing (not term archive)
- Return the name of the post type
- make permalink go to a custom single.php file
- Add Previous/Next Buttons to CPT Single Pages Only
- Assign CPT archive page attributes
- Creating Sections for Post Types
- Set a hard-coded page-template (post-type-archive) as home/front-page of my wordpress blog?
- Custom post types with categories in template
- Custom taxonomy or custom page templates?
- Dynamically insert an article at the top of a taxonomy archive – or?
- Inserting custom fields into single.php
- Archiving custom post content?
- archive as a page, so that it can be added in the wp_menu_nav
- Creating separate feeds for custom post types
- Can anyone clarify difference between archive-{posttype}.php, type-{posttype} and date.php?
- Which file/template is in charge of taxonomies for custom post types?
- How can I trace inconsistency in loading a template?
- hide specific div on single.php [closed]
- How do I add custom HTML to the content of an archive page’s posts?
- Only show posts with a specific term of an associated taxonomy in a custom post type archive
- How to get_term_meta on single custom post?
- Archive links for custom post types
- Show All Custom Post Types On A Single Archive Page
- Use the custom post type archive for taxonomies?
- Assigning alternate single-{cpt} template based on blog_id in multisite
- How do I assign a block template (.html) to a custom post type?
- Templates for hierarchical custom post type
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- Archive Page for Multiple Custom Post Types
- Apply template by path/slug related to custom post type?
- assign different templates to custom post type with homepage loop
- How to show custom field on specific custom post type posts only when filled
- Display Date & Author Info on Custom Post Type Archive Page
- How to get the current category with custom posts
- Custom post type is using the index.php template
- Assign a template to a custom post type when displayed by the main loop on the home page