Hi @zyntsz
I would look over the following two links for how to structure and name the template files themselves.
https://developer.ww.wp.xz.cn/themes/basics/template-hierarchy/#custom-post-types
https://developer.ww.wp.xz.cn/themes/basics/template-hierarchy/#single-post
Most specifically, archive-my_post_type.php and single-my_post_type.php would be the file names you want.
you’ll want to use the slug value, not the rewrite slug value.
Thread Starter
zyntsz
(@zyntsz)
@tw2113 I have such files with single-posttype.php files but it doesn’t work. Where should I put the files in? I have child theme and have tried putting it in there.
-
This reply was modified 3 years, 9 months ago by
zyntsz.
Child theme, top-most folder.
The listings shown at our “Registered Types/Taxes” screen should be showing the matching template names to use at the tops of those lists.
Have you made sure to activate the child theme as well?
Thread Starter
zyntsz
(@zyntsz)
@tw2113 by top most folder, do you mean directly inside child theme folder? I only have two files in child theme function and style. By putting there it just shows blank white screen now. I guess the problem is with the php file. Instead of having get header and get footer, it just calls another function with render.
-
This reply was modified 3 years, 9 months ago by
zyntsz.
yep, that’d be the right place. Now it sounds like you’re getting some PHP errors. May need to reference the parent theme’s documentation and/or support on how to best create child themes.