PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, August 26, 2022

[FIXED] How create different page for every different posts in wordpress?

 August 26, 2022     wordpress, wordpress-theming     No comments   

Issue

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

Solution

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



Answered By - Igor Yavych
Answer Checked By - Marie Seifert (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing