I’m creating a plugin for WordPress that creates a new post type for news and events (yes, yet another one 😉 ). The post-type is registered under the name gg_nae.

The post type works as expected; the post type can be saved and edited.

Now I want to create a custom template file. I called it single-gg_nae.php and I saved it in the same folder as the plugin-code.
If I understand the explanation on https://developer.wordpress.org/plugins/post-types/working-with-custom-post-types/ correctly that should be enough to render the post type in the custom template, but it won’t. It renders the post with the single.php file from the template.

If I move the custom template to the theme-folder however, WordPress uses the template as intended; it renders the post in the single-gg_nae.php template.

What am I doing wrong here? Should single-gg_nae.php be placed in a specific folder in the plugin-map?

Read more here: Plugin single.php not showing


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: