I have created a custom post type ‘projects’ with CPT UI and can’t figure out how to overide the theme files. I’m guessing I need to copy over single.php and wp-single.php to my child theme. Which I’ve done and renamed them to single-project.php and wp-single-project.php as well as changed the x_get_stack to reference wp-single-project.php in single-project.php. What I’m not understanding is the x_get_view() in the now renamed wp-single-project.php. What is get_post_format() doing? How do I insure I am only overiding my custom post type projects?
Hello Bob,
Thanks for writing in!
The get_post_format() will retrieve the post format of your post or custom post type.
- https://developer.wordpress.org/reference/functions/get_post_format/
- https://wordpress.org/support/article/post-formats/
Having the wp-single-project.php file in your child theme would ensure that you have a dedicated custom post type template. I would recommend that you check out the wp-single-x-portfolio.php and everything related to the portfolio since the portfolio is a custom post type.
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.