How to Create Custom Single Template in WordPress

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 For a Specific Category in WordPress

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.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Article Tags: , , , , , , , ,