By: Prem Tiwari | Last Updated:
I got some tutorial request for “How to Create a Custom single template for a specific category in WordPress” from my blog readers so that I am creating a separate tutorial for this request.
If you are looking to create a custom single page template for a specific WordPress category on your blog or website, keep your close attention in this post as I am going to share how to create custom single templates for a specific category.
Follow the below steps to create a custom single templates in your WordPress blogs.
Step 1) Create or copy content-single.php and create a new file. eg: content-yourCategory.php
Step 2) Open single.php and replace this get_template_part(‘content’,’single’); by the following code:
Note: The parameter “yourCategory” can be your Category ID, Category Title, Category Slug or Array of IDs, names, and slugs.
Hope this tutorial help you to create a custom single post template in your WordPress blog. Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.
Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies. View all posts by Prem Tiwari
create a custom single post templates, single post, single post in wordpress, single post template, wordpress custom single post template, wordpress tutorial, wordpress tutorial for beginner, wordpress tutorial for beginners, wordpress tutorials for beginners