Hi, i created a custom post type (portfolio), in the documentation it says create archive-portfolio for archive.
However this name does not get picked up as archieve template it just show regular archive, i created content-portfolio and that seems to register as the portfolio archive, can you help me shed light on this please?
I just need to know what to call the single page name and the archive page name for a custom post type.
We don’t change the WordPress template hierarchy, so archive-$posttype.php
and single-$posttype.php
should be what you’re after.
If you’re struggling to see what templates are being loaded you can use the Roots wrapper toolbar plugin, which adds the templates being used to the admin bar.
1 Like
Thank you, i guess i was expecting to be able to create archive-$posttype and single-$posttype.php within the template file, but i have to make them in the root as usual.