If, from within single-films.php
you filter based on the parent post you should have little issue with this. For example:
if( $post->post_parent != 0 ) {
// not top level
} else {
// top level page
}
If you need to know how deep the page is, that’s a different matter, but that’s also doable (unfortunately it means you need to query the database though).
Related Posts:
- A case for Hierarchical Custom Posts
- Templates for hierarchical custom post type
- Specifying Default Template for Hierarchal Custom Post Type [duplicate]
- Custom post type pages return 404 page?
- WordPress 3.9 not using custom template
- 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
- Custom post_type search pages
- how to remove pages loading with the archive templates
- Custom Post type & Taxonomy 404
- Main query not querying any posts in custom taxonomy template
- Custom Empty Results page for my Custom Post Type
- Custom posts template page
- Is it safe to change a Custom Post Type from “hierarchical:false” to “hierarchical:true”?
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- How can I use archive-{post_type}.php theme template?
- get parent content inside child posts
- page template for custom post type
- make permalink go to a custom single.php file
- Add Previous/Next Buttons to CPT Single Pages Only
- Creating Sections for Post Types
- Custom post types with categories in template
- Creating separate feeds for custom post types
- Which file/template is in charge of taxonomies for custom post types?
- How can I trace inconsistency in loading a template?
- How to get_term_meta on single custom post?
- Assigning alternate single-{cpt} template based on blog_id in multisite
- How do I find a way to create a global single.php for a custom post type?
- How do I assign a block template (.html) to a custom post type?
- custom hierarchical taxonomy and custom post type list contains surplus posts
- Creating a non-hierarchical Taxonomy that behaves like categories
- How to use single.php for creating, reading and editing Custom Posts with ACF
- Custom Post Type setup
- How to query for posts (hierarchical custom post type) that have children but are NOT top level?
- Apply template by path/slug related to custom post type?
- assign different templates to custom post type with homepage loop
- Migrating Hierarchal Taxonomy Categories Between Post Types
- 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
- Ideas on how to organize a project [closed]
- Add search to ‘Parent’ dropdown
- Get template part with CPT and Custom Taxonomy conditionals
- Template code to split a post and print a custom field?
- Displaying a list of Contacts
- How to create a template to show child terms of a MAIN taxonomy
- How to change single custom post template by custom taxonomy?
- Custom Post Type homepage template
- How should I structure complex content hierarchies?
- Custom permalink structure for remote content pages
- Query all post types but limit to parents
- List child categories from parent category on custom taxonomy page
- Setting a homepage – doesn’t seem to work
- How to create a archive template for custom post type [duplicate]
- WP not recognizing custom post type / template
- Archive Template being used instead of Category Template for Custom Post Type
- Custom post type draft use wrong template
- List of a specific Custom Post Type in Custom Template
- Create a custom taxonomy template that loops through child categories in term order?
- Custom post type hierarchical loop in Homepage
- Display Posts Query with IF function
- My template won’t apply, theme still fallback to index.php
- How can I add in post’s the text “No content”
- Require custom post type if is_admin() – template doesn’t show up?
- How to customize `Edit-Post` Screen
- Calling a div and content in php?
- Tag template not returning posts [closed]
- Does “Custom Post Type” can have page hierarhy option?
- Set generic reservation form for custom post type
- Function to allow single post template based on custom taxonomy?
- Creating an Events Feed with Sub Pages/Posts for Each Event
- Shortcode in pages or tempate files for custom post type
- One Custom Post Type two different Templates
- How can I allow users to edit text that will be displayed on a custom post type archive page?
- Specifying a template for custom post type pages
- handling templates and widgets for custom content types
- Conflict in function to allow single post template based on category
- How to make post templates to include shortcodes only?
- Custom Post Type, Custom Taxonomy Template: How to get current taxonomy name?
- On click some element i want to use some template
- Custom post type set default template using block editor
- How to set a ‘page’ as parent of a custom post type?
- Permalink with hierarchy of Custom Post Types
- A certain theme is forcing it’s singular post layout
- Post template with breadcrumb needs to show page navigated from
- Setting Custom Post Type Parents/Hierarchies
- Custom taxonomy terms hierarchical navigation
- Having hierarchies inside WordPress custom post type
- Post template not applying on theme (potentially rendering as Page template)
- Add custom template ‘sub-page’ to Custom Post type?
- Load info from customposttype into template page
- Custom post type defaults to index.php for archive page
- custom post template design with dropdown option
- How to convert hierarchical Pages to hierarchical Custom Post Types? Slugs get a number as if they were duplicates
- Custom Post Taxonomy Template Not Loading Properly
- Accessing download link from the loop with WP Download Manager Pro
- Custom post type single page uses the right template in preview mode but shows a different template after being posted
- Warning , Use of undefined constant PLUGIN_PATH?
- Post Attribute Section missing for Custom post type