How to Create Custom Single Template in WordPress

| Last Updated: | In: WordPress, WordPress Snippets


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.

How to Create Custom Single Template in WordPress

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.

Over to You

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.


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is 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.


You may also like:


, , , , , , , ,