Precious version 4.0.1 comes with the ability to use custom Single Templates, just like you can have Custom Page Templates.
You can use this feature if you need a slightly different setup on single posts in a special category, a special tag etc, etc.
How to create a Custom Single Template for Precious
- Open the single.php template file found in the precious directory.
- Edit the file to your needs
- Save file as single-something.php
How to use a Custom Single Template
Before you can make use of your Custom Single Template you need to upload it to either (1) Precious’ theme directory or (2) the directory of the Child Theme you are using on your site.
If you use option (1) the Custom Single Template can be used on any Child Theme of Precious.
After uploading the file you need to do the following when when writing/ editing a post:
- Scroll down to (and open) Custom Fields in your Edit Post window
- Put single_template in the Name field
- In the Value field you add whatever name gave the Custom Single Template. (In this tutorial the value is something as in single-something.php)
- Press Add Custom Field
Notes and tips for using Custom Single Templates
After you have used the Custom Field name for the first time, you’ll be able to select single_template from a dropdown list in Custom Fields.
To make it easy for you to remember the value of Custom Single Template you should save the file with a name that’s describing.
Example: You want to use a Custom Single Template for you blog category Music, you can name the file as single-music.php which again will make the value of single_template to music.
Want the code?
If want to add this feature to your own theme, feel free to download the code
If have any questions about this feature, feel free to add a comment below.