If the template page in question is the archive index for the custom post type, you can simply create a custom template file, archive-{post-type}.php
, and add in the Title and custom text.
If you don’t want to create a custom template file, you can use this boolean as a conditional in your existing archive.php
template file, for creating custom output:
<?php is_post_type_archive( $post_types ); ?>
To retrieve the Title for a Post Type archive:
<?php post_type_archive_title( $prefix, $display ); ?>
To retrieve the current Post Type (for use in PHP):
<?php get_post_type( $post ) ?>
To retrieve all Post Type information (e.g. to output Title, Description, etc. if configured):
<?php get_post_type_object(); ?>
Related Posts:
- Load a script just to custom post type in admin
- Handling front-end file uploads, considering safety and ease of use
- How to set a fall back template for a custom post type in a plugin?
- Post formats “audio” and “video” only showing in index.php
- How do I implement custom fields without using any plugins?
- how do I group content in magazine-style ‘issues’?
- Prepend regular Posts with custom slug, without affecting Custom Post Types?
- Semantic URL Custom Post Type and Taxonomies permalinks
- Pagination with custom loop
- WordPress custom post action hook
- Display metabox conditionally
- Change plugin’s has_archive = true to false?
- How to remove thumbnail sizes for specific post type on a child theme?
- Do attachments added to custom post types have a post parent?
- Get slug to point to different content of the same post
- How to make an archive page displaying posts in a date range
- Categories and Tags not working!
- Is slug “type” reserved and can’t be used in taxonomy rewrite?
- WordPress Rest API only returns content when posttype has editor capability
- No checkbox in wordpress posts list table for CPT
- Custom Post Type relationship with hierarchical parent and child permalinks
- Best practice for adding posts in bulk
- Help Structuring Query for Archive Pages
- Custom Post Type vs. User Page
- How to rewrite custom post type with custom taxonomy urls?
- Hierarchical Custom Posts – Highlighting Current Post in Sub-Menu
- Display all custom post type posts and order them by an optional meta_key
- Selecting New & Edit Page for Custom Post Types
- Creating template with h3 block (block editor)
- How to structure a site with product variations pages?
- check if post title in a custom post type exists in page
- Call custom post type by category
- Archive template not working for custom post type
- How to get updated data when save_post triggers?
- Push metadata in array
- Get template part using a custom taxonomy term
- Displaying custom taxonomy in the admin list of a custom post type
- Make metabox of custom post type fully autosave- and bulk-/quick-edit compatible
- Creating a Custom Post as a repository for theme constants
- Second Set of Eyes: One custom taxonomy shows in Appearance > Menus, one does not
- Hiding posts by other users and non-logged in
- Custom Taxonomy terms aren’t getting referenced or saved in Quick Edit or Bulk Edit, only on Single product page?
- Add Pagination on Custom Post Type Archive
- Several CPT’s with same Taxonomy name but with different Terms for each
- Order Custom Post Type by Custom Field Value
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- Get the taxonomy of a post hierarchically
- Query posts based on the meta key values of logged-in users?
- Hierarchical custom fields
- How to order posts of a custom post type by date DESC in dashboard Admin?
- Fields for different parts of a page
- Plugin fatal error
- Sizing textarea field in custom metabox
- 4 column-loop ordered alphabetically with entries grouped (and labeled) by their first letter
- Is there something like has_no_term
- Custom post-type metabox position
- I can’t access custom taxonomy page listing
- Displayling list of Custom Post Type Posts
- List of Categories for Custom Post Type
- $post->post_meta not pulling any post in wordpress/php
- WordPress custom API endpoint – how to make the request more flexible
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- Need alternative get_posts function for custom post type
- How to get post type information?
- How to display a WordPress Custom Field only on a specific day of the week?
- is it possible in a custom post, create custom fields as well whitin?
- Display registerd taxonomy in admin dashboard
- Take stored email addresses from custom post type & turn into one string
- WP_Query order custom post type with certain meta key value by post modified date
- Cant’ Display Custom Post Type Title Base on Tax Terms
- How to show multiple images in a slideshow for a portfolio page
- How to eliminate custom posts where the “date” value is expired?
- Pagination in custom post type archive.php not working
- How to filter a matched value with custom key using WP REST API?
- how to display author name in custom post type
- Sort custom post column by generated value?
- create a “add icon” field in taxonomies page
- Custom Post Type Pagination getting 404 error
- How to search through all child taxonomies using WP_Query?
- Custom Post Taxonomy Template Not Loading Properly
- WordPress retrieving $post based on random key in $_POST
- Show ajax form resuslts in page
- How to make “single post” permalink maintain it’s sub-page structure
- wp_nav_menu doesn’t seem to work on custom post type pages
- Custom meta box in editor of custom post type not working
- Calling in Post Content via AJAX
- Multiple custom post type and permalink issue
- Using mediaelement to display gallery of audio
- Help ordering custom query by Title, Ascending
- How do I set a specific size for my image?
- group posts by month/date ignore years
- Toggle a metabox based on a selection
- Image paths on custom post types getting /post_type/ added to path
- Problems with custom post type and hierarchical permalinks
- Issue on Adding Taxonomy to Custom Post Type Using Function
- Show custom taxonomies in admin panel under custom post type
- How to hide home title on pages and posts?
- Limit wordpress posts loop to continue onto another page
- Posts structure named to blog, how to add month and year
- How to change post cpt with submit button?