I got it. It kind of makes sense but doesnt really. The one template wasnt working becuase I was looking for just the slug. Since its a child of the other page I needed to add it in the is_page
statement. This worked (I also just did it all in one function):
function ch_register_page_template($page_template;) {////////////////<-------------Works
if ( is_page( 'CH' ) ) { //change this to match slug
$page_template = dirname( __FILE__ ) . '/inc/page-ch.php';
return $page_template;
}
if ( is_page( 'CH/CH-Thank-you' ) ) {//change this to match slug
$page_template = dirname( __FILE__ ) . '/inc/page-ch-thank-you.php';
return $page_template;
}
return $page_template;
}
add_filter( 'page_template', 'ch_register_page_template' );
Related Posts:
- Is it possible to upload a template file to a directory that can be used by all themes?
- Is there any way to get all the name or slug of template parts used in a page?
- Create a custom page template inside my wordpress plugin
- Register Page Template from Plugin
- Plugin-generated pages use Not Found or Pages Archive templates?
- How do I show content from a plugin using the template the site is currently working with?
- WordPress Product Detail and catalog
- Plugin json page
- How to use custom footer template in a site-plugin?
- Custom Page Templates for a complex application – code must sit in a plugin and not the Theme
- How to create a page template using custom plugin
- How to provide page_template path in custom plugin using WordPress
- Why do I get this “plugin does not have a valid header” error?
- Edit plugin without hooks in functions.php
- Which method is best to enqueue scripts
- WordPress Capabilities: edit_user vs edit_users
- Making plugin unique to not conflict with plugins with the same name
- Is dynamic forms/entries possible in Widget?
- Is there a WordPress Plugin that allows voting “does this coupon work” on specific links like Retailmenot
- How to get posts by content?
- Trigger a custom wordpress plugin with a linux cron
- Template plugin for blog posts? [closed]
- Force plugin to fail activation
- Plugin not saving values when placed in a folder within /wp-content/plugins
- How to integrate plugin in WordPress theme
- How do I write into a file (css)
- Is license need for free wordpress plugin
- Getting a List of Categories for Use in a Plugin?
- Allow users of my plugin to define their own shortcode rather than use mine?
- Building plugin with changeable custom post type values…advice needed
- How to get all of the activate_plugin action parameters?
- Display update notification messages like ‘What’s New’
- CRUD and Frontend show from a custom table without shortcode
- How can I make 2 plugins that include different versions of a framework to both use the latest version?
- Add Plugin options as subpage to Theme options page
- Image upload and download from front-end
- What can be reason for no plugin-strings available under stable section on translate.wordpress.org?
- correct way to include a library(and its dependent libraries) in wordpress development
- Issue Tracker from pre exsisting table [closed]
- WP_Terms_List_Table Quick Edit not working
- Git Hosting for WordPress SVN Plugin Repository [closed]
- Is there a directory my plugin can write files to that cannot be viewed via the browser/url?
- How to exclude certain files from the plugin editor?
- Stop Plugin from Getting Styles from Other Plugin
- WordPress REST API Plugin Development – Add Custom Endpoint
- Hook into the rendering of a WordPress Template
- Default taxonomy template in plugin, override in theme
- Trying to add a page template for my custom post type from a plugin, but it will not display in the template dropdown unless file is in theme
- How to add support for caching plugins for my own plugin?
- Save user total active time after login in wordpress [closed]
- WordPress gtag.js with User ID tracking
- WordPress Site is Broken, Cannot see wp-admin page [closed]
- wp_loaded with static Singleton
- How to remove a CPT Menu from the Root Admin only
- Get post_id on clicking a link in WordPress
- WordPress.org: How to add a plugin for certain countries?
- Calling a save function from a “submit” button
- Unable to give correct path in wordpress
- Disable variations on woo commerce if out of stock
- How to add img into a plugin?
- how to request a script more than once in wordpress
- How can recognize post’s category?
- How to log custom plugin error to debug.log file
- How to hide plugin submenu title in drop down in admin panel in wordpress?
- How to create admin setting for this small plugin
- How to fix caching issue in PHP data from database
- Show Custom Post on Frontend
- Adding shortcodes to multiple pages with function
- SASS not showing in customized preloader plugin
- How to securely controlling data without keeping it in postmeta?
- Get a list of Product Categories inside a loop
- WordPress Ajax request “Failed to load resource: the server responded with a status of 400 ()”
- Can you develop themes and plugins while using the hosting services BlueHost? [closed]
- Using multi-dimensional array with filter
- WordPress Admin sub-level menu issue
- PHP header() not available to use in my plugin
- wordpress ajax pagination object value does not change
- Google analytic issue in wordpress
- Custom pages with plugin
- How to insert category name above post title in a featured pages plugin?
- Displaying friend’s posts only
- How to add submenu to WordPress plugin in the same Directory of main Plugin?
- Check if user is in a group of another site within multisite network [closed]
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- Redirect url in plugin to somewhere else?
- How to set-up multiple cron task with wp_schedule_event so that they do not overlap?
- Site is setup statically – how to make it content managable?
- Modifying lightbox plugin to allow for quoting, Does this exist? [closed]
- Plugin version number after code rewrite [closed]
- How to escape html code?
- How do I set register_meta for a specific CPT?
- How to Enfroce Domain Licensing Limits? [closed]
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Update Content for a Custom Block Toolbar Button
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Wrong block appender button showing
- Uncaught Error: Cannot use object of type stdClass while showing the list using WP_List_Table
- Submitting form to admin-post.php WordPress
- WordPress Throwing Deprecated Errors on its own Files
- plugin doesn’t retrieve data from database