J
J
Johnny Show2018-08-03 11:52:50
WordPress
Johnny Show, 2018-08-03 11:52:50

How to create your own template on the post output page of the created Custom Post Type plugin?

I decided to create a Custom Post Type plugin, the posts are displayed, but the page apparently loads the native WP template from the Posts page. How to remove the unnecessary sidebar and header, i.e. to make your own template for the post output page of your choice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan Hasanli, 2018-08-03
@azerphoenix

Hello!
Explore the template hierarchy...
In short:
taxonomy-TAX_NAME.php (for taxonomy)
single-CPT.php (for single post)
Copy templates archive || category.php rename to taxonomy.php (as above)
Copy single.php and rename to single-CPT.php
And there you can already edit as you like

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question