Custom Post Type with Template
-
I have a problem where a custom post type seems to not be fully registering.
I have created a set of custom post types using CPT UI. Which works. For example I have “route” and “country”. They show up in my admin and work.
To create a template for “route” posts I duplicated the following files into my child theme in the same directory:
1) single.php becomes single-route.php
2) In single-route.php I updated the code from:
<?php x_get_view( x_get_stack(), ‘wp’, ‘single’ ); ?>
to this:
<?php x_get_view( x_get_stack(), ‘wp’, ‘single-route’ ); ?>
3) content.php becomes content-route.php
4) I updated the following code in content-route.php from:
<?php x_get_view( ‘ethos’, ‘_content’, ‘post-header’ ); ?>
to this:<?php x_get_view( ‘ethos’, ‘_content’, ‘route’, ‘post-header’ ); ?>
4) wp-single.php becomes wp-single-route.php
All of that worked, my new template applied to the “route” custom post type.
Now, a week later, when I repeated that process substituting “country” in place of “route” it does not work for me. The country posts return a 500 error.
I kind of remember that there was another step I had to go through to force the full registration of the new post types. Is there something I am missing?
Thanks for any help you can provide.
The topic ‘Custom Post Type with Template’ is closed to new replies.