Display CPT’s using template file not being used

When using custom template file, (for example – tmpl-programs.php), to display custom post types (programs) in a theme, there are some common behavior that can cause problems.

When our page that uses a custom template file, archive.php file is used instead, which isn’t what we want. Alternately, we can create a file with the name archive-{post_type}.php to display our CTP’s.

Using a plugin like what the file, has been super helpful when trying to figure out these common issues like what file is being used.

Also, going to review the WordPress file hierarchy may help solve this.

Check for our CPT declaration, and make sure that has_archive is set to false in our CPT plugin.

Another thing that is easy to forget is not saving your permalinks afterwards.


by Norm Euker