Well, even at a quick glance, I can see that you are using the same meta box ID – postparentdiv – both times, which probably causes issues internally.
That said, this seems a convoluted path to take at all, and possibly an XY Problem.
Why do you need to scan for templates at all?
Related Posts:
- Query custom post type and showing its content
- White screen error for a custom theme
- Custom template with CPT doesn’t display on frontend
- Custom Post Type with Templates using Meta Boxes?
- next_/previous_post_link() `in_same_category` appears to fail when true
- Want to be able to sign up subscribers as authors
- providing access to post_id or post inside functions.php
- how to display custom taxonomies in front page
- I want to show a list of posts under specified categories
- 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
- How come Featured Image isn’t showing up in my Custom Post Type?
- How to use a custom post type archive as front page?
- Set posts of a custom post type to be private by default?
- Custom post status not working
- Add Content to Page without shortcodes
- clients list using wordpress
- Why is get_post_format() for “Standard” returns empty
- Find callback function for custom taxonomy metabox
- Date archives for custom post type
- How can I add dropdown widget/box to admin post page?
- Password-protect a custom rss feed
- Assign Page Template Within A Custom Post Type
- Page Templates – this code only works for one Custom Post Type
- Custom Post Type – Archive page title
- Single Page WordPress CSS and JS links
- How do I create a custom post type for a training CMS in WordPress?
- Returning Variables back into a template
- Custom Post Type slug same as page name causing a conflict
- Append taxonomy terms as class names in markup?
- Display only custom post type count for current author on the “At a Glance” dashboard widget
- I am trying to output portfolio items with a picture. This code doesn’t seem to be working. What am I doing wrong?
- Help with CPT template pagination
- Loop through posts of a custom-post-type (event) and create .ics (iCal) file?
- Page Templates Drop Down Select for Custom Post Types
- GravityForm: Populate Dropdown with custom post type [closed]
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- WooCommerce product search titles only
- Custom Taxonomy Permalinks Redirection
- Add custom column in custom post type edit page
- I did group my search results by post type, but how can i give each of them its own order?
- create a template page for a post
- custom post type not showing in menu
- Custom post type archive page template
- Change CPT archive title
- I need to add endpoint for wordpress categories
- Featured image overlay when changing post status
- Hide a widget inside a div on specific type of post
- How to make custom taxonomy into drop down select in a custom metabox
- How to change permalink to include custom post type
- Warning: Invalid argument supplied for foreach() [closed]
- Custom post type isn’t working
- custom post for slider
- Navigate posts with different post type that are in the same categories
- How to inherit field value from parent post into in child / sub post
- Custom post type’s posts are not showing anywere but in xml sitemap
- Get current user id
- How to get the current category with custom posts
- Create a simple Testimonial page
- One Site. One Theme. Multiple Stylesheets without plugins?
- Custom Post Type – Portfolio no longer works
- Custom posts – tag pagination
- Adding custom post formatting options in custom post types
- How to add page under a custom post type?
- Custom meta box in custom post type not working
- Custom Post Type Specific Post Template
- Function to add custom HTML into head in custom post-type list page
- Submit Custom Postypes from frontend
- Need help with Custom Post Types and Taxonomies
- Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?
- Invalid content when I try to import custom post type from the old template wordpress
- How To Display Posts Of Custom Post Type At Page Template
- set object terms after some some time of published post – functions.php
- Is there a way to use ‘publicly_queryable’ => false only on specific taxonomy term?
- How to add specific terms in a custom post type?
- Limit custom post type to the authors only on front-end!
- WordPress Page hierarchy ( parent is singular of custom post types slug ) is returning not found
- Urgent – WordPress keeps creating posts
- Custom post type not pulling CSS
- Create posts inside CPT post
- ACF field check value of field on all other articles
- Custom permalink rewrite rules – how do I fix this?
- Populate custom post type/custom fields from an external database
- How to sort custom post’s category by id from the theme’s function.php?
- Work and Display a Custom Post Type as a normal Post
- Custom Field to post_title
- Change Background Color For CPT Template
- Post Custom & Taxonomy 404 error
- How To Display Category list from Portfolio post type plugin?
- Adding CPT changes entire layout of my site except for the archive of that CPT
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- Dropdown switching subcategories portfolio
- custom fields not showing before get_header
- Custom Post Type Pagination Not Working or Single Posts Displaying?
- Modifying and Displaying URL’s in a Post Template using parse_url
- Query by post type or category
- Allow authors to create article image
- Comments are not working on Custom Post Type
- Adding custom theme template to custom post type [duplicate]
- How to use wp_set_object_terms depending on page ID?
- How can I produce multiple webpages with a different output based on one entry/Page/custom Page?