Md Anik Rahaman
Md Anik Rahaman

Reputation: 107

How create different page for every different posts in wordpress?

I am developing a website where I am required to have individual pages for every different posts. I have to put 8 posts in eight different styles and properties, that is why I need those pages.

For example as we know for each page template we can make something like

page-templateone.php

Like that I want something similar for posts, just for example:

post-numberone.php

Upvotes: 0

Views: 44

Answers (1)

Igor Yavych
Igor Yavych

Reputation: 4244

You can create a following php file in your theme folder

single-{post_type}-{post_slug}.php

For example, you have a post with a slug very-important-post. To have a template for this post alone, you need to create a file called single-post-very-important-post.php

If you'd like to be able to select template from the post editing screen, in 4.7 post type templates became available. Read more here
If you'd like to be able to do it in the older verion, take a look here

Upvotes: 3

Related Questions