Hello Friends !! Since a long time, I am working with wordpress and I got lot of challenges with wordpress customization.
Recently, I have a confusion that,
how can I make different single.php file for different posts?
After long research, I got a solution of this problem.
You can create as many single.php files as you want and you also can apply it to different posts. For example, In your site News section has a different layout then blog posts. At that time, this post will be very helpful to you .
Here I give you example that how you can do this.
First , create one file called single-categoryID.php in theme folder.
After creating this, go to single.php file which shows you full article.
After header, write below code:
include (TEMPLATEPATH . ‘/single-9.php’);
include (TEMPLATEPATH . ‘/single-10.php’);
rest of the code…….
Where ‘9’,’10’ is category id.
You can create as many templates as you want. You can also create multiple headers like this and include like asame above code.
Thats It !! Enjoy different template for different posts.
If you have any wordpress customization query or any confusion, feel free to ask me or comment me.