I have created a hierarchical custom post type in wordpress called “films.” It is hierarchical so it can have children elements.
When a “film” is clicked, wordpress automatically uses the template called ‘single-films.php’. That is great, but I wish to use a different template when one of the film’s children pages is clicked. For instance, a child of a film might be “press.” When that film’s press link is clicked, I want it to use a different template than single-films.php.
I was hoping there is some way I can use a template like single-children-films.php. Any ideas how I can change a hierarchical custom post type’s children template?
I think I have just done the same thing:
I had a custom post type called “product” the parent is the ‘brand’ and the child is essentially an ‘item of the brand’ here is what I put in my single-product.php
This is the first query to get the child posts [items]
I’m certain I can help out with this. I just need to know one thing, are the children always of the same post type as the parent? Or is “press” as you said in your example its own separate custom post type?