Using body_class()
on the body tag would probably be the easiest way to tell which template is in use.
<body <?php body_class(); ?>>
Depending on which page you are on, it will output similar to this
<body class="page page-id-10 page-template-default logged-in">
Where page-template-default
is the template in use. It’s also useful for blog posts and custom post types.
Related Posts:
- Prevent trash/delete action on specific post types
- How to add custom content template part for a custom post type on main query using a plugin
- Loading custom page template via plugin
- Why The Init Hook For Custom Post Types
- wordpress plugin error handling
- How to get term link that crosses different custom post types?
- register_taxonomy with multiple object type and update_count_callback
- How often do you need to register_post_type?
- Where to put archive-{post-type}.php
- How to use a dedicated template for the Custom Post Type from a plugin?
- How to append text to title of Custom Post Type post (without affecting all titles on page)?
- Custom Taxonomy and tax_query Issue?
- Use a textarea for a custom post type
- How to register custom post types in a plugin?
- Actions that Run on Admin Edit Page Load After Posts Are Queried
- Custom role capabilities to administrator not taking effect (no plugin)
- How do I include drag-and-drop in a plugin?
- How could I create a ‘private comments’ section on a custom post type?
- How do I alter the position of a Custom Post Type menu item within my plugin admin menu?
- Issue with pre_get_posts on custom post type archive pages
- Get rewrite slug of custom post type in template
- Detect where custom post type is declared
- Metadata for a taxonomy – is there any WordPress way of doing this?
- Hook to override title, image and content
- Why is conditionally loading a custom plugin’s code only on a specific custom post type causing the site content to disappear?
- get_object_taxonomies() returns empty array for custom post type
- No posts found – Custom Post Type show_ui
- Add custom ID to CPT posts only create not update
- Add custom post type as submenu [closed]
- WordPress multiple custom post types capability conflict in a single menu
- Add Custom Post type menu to another menu in specific location
- Set a CPT slug as a base name for all the taxonomies
- A custom post type in another post type
- custom comments form for custom post type
- Problems wp_insert_post and save_posts filter
- wordpress remove views from action links in a custom post
- When should I create custom post types?
- Custom post type’s extra fields – how to handle?
- Send a conditional email notification when a custom field value changes in Post Type
- how to set a WP Plugin’s url
- Getting 400 Bad Request on AJAX Call
- Main query not querying any posts in custom taxonomy template
- detect your custom post type in WordPress
- Option page’s form doesn’t work
- How can I include active content in a custom post type?
- Show current custom taxonomy
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Add to ‘action’ within post.php to allow more actions when editing a Custom Post Type in a plugin
- ajax response not recieving
- Add post type pages with plugin
- How to List Custom Post Type Titles Based on Theirs Taxonomy Terms Inside a Nested Loop
- CPT to installable Plugin
- Most viewed post of custom post type
- filter the_content, custom post type, and wp_query
- Fill custom fields when saving custom post types
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Mandatory field in Custom post
- Custom post type page with parameter
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Custom post category name showing empty
- How to store the third party script with HTML code in the wordpress custom input field?
- How to show the post which checkbox is not selected
- Is it possible to get the specific content on the search page?
- Get next and prev item from custom WP_Query and Custom Post Type
- Replace Content of Sidebar on Custom Post Type
- How add Filter by Tags and by categories to custom post type in Gutenberg block
- How to upload an image to a custom post type
- Error 404 change permalink term custom term taxonomy
- Show a custom post title in another custom post type in Meta box
- Register custom_post_type from static function
- I have a random letter appearing before my content. Where to start looking for the cause?
- How to select meta key in custom database query
- Restrict Custom Post Type to One Item
- Correct way to register custom post type from external php file?
- How to seperate posts by categories?
- How to Use A Custom Post Type as Taxonomy for Another Custom Post Type
- Widget area for individual posts (custom post type)?
- How can I load Template file from wordpress plugin
- Which File Populating CPTs in Slug URL
- Front End users account with lots of user Roles (not Woocommerce)
- Custom post type that lets users create a set of posts?
- Not Able to List CPT Based on Taxonomy Term
- Foreach in get_post_types to apply a different filter per post type
- How to develop custom URL redirection
- In WordPress do I create tables for my plugin or do I create custom post types for a Student and Classes Registration system?
- Execute code only after user clicks ‘update’ button for CPT being edited
- Can the wp_posts table have the same slug (post_name) in multiple statuses (post_status)?
- Display custom post type archive on page.php template
- get_post_types doesn’t work in plugin
- Show Templates in Custom Post Type Editor
- Render custom taxonomy query as single template
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- Add category slug as class attribute in a link array
- Custom post types working in functions.php but not in plugin
- Resources to learn OOP for WordPress plugins, custom post types, etc
- How to create an upload page (front side)
- How to dynamically register custom post type
- Menu Structure and URL structure, with Pages and Post-Type-Posts
- Custom Post Type urls not working
- I want to show a list of post with title that have link goes to that post and icon under the specific category to which it belongs