CREATE TEMPLATES DIFFERENT FOR SINGLE POSTS
single post templates
Get started by making a search going on “Plugins> Add New” section of your WordPress blog. Perform a search for “Single Post Template” and click “Install Now” to install the plugin and activate it on your blog. We will assume that you activate your plugin. Once activated, go to the next step:
Once you have the plugin installed, what you should do is to create new templates for their single-posts. To do this, we recommend that you copy the code from your single.php file to a new file, and put at the beginning of the header following code:
Single Post Template: [Template Name]
Description: The description and optional. Write if you want!
Please note that if you want your single.php is different from other template you want to create, you need to edit the code of this template and assign it a new different such as single-tutoriais.php, which will be the template to use in their tutorials. Load those files into the board / wp-content / themes / nomedotheme / so that they automatically become active and functional:
Do not forget that these new files necessarily have to have the header that we talked about earlier , otherwise the Single Post Template plugin can not interpret which files are single templates posts .
When loading files, the plugin “Single Post Templates” will automatically understand which single templates posts, and provide a dropdown menu selection within the WordPress articles editor. Below the writing of a new article box will now display the Custom Field to “Single Post Template” that contains all single posts templates you created.
CREATE TEMPLATES FOR DIFFERENT CATEGORIES
The WordPress template hierarchy works following an analysis of logic. It will search for templates by following a certain order, see:
This order means that WordPress will first look for a template category-6.php after the category.php, and so on until you get to index.php. This means that create different types of templates in WordPress is actually a super simple and basic process.
To create a different category of template category.php, copy the code that is within your category.php file and save the new file with the category-ID.php name, where the ID means the ID of the category where you want this template is applied. If you do not have a category.php file, you can copy the archive.php or index.php file.
To find the category ID you want, enter the ” Categories” section of your WordPress blog , put your mouse over the category name , and look at the address bar that appears at the bottom of your browser. This address contains the ID = X, X being the ID value in its class . It has nothing to deceive.
So that everything is working properly, you should load into your server, in the / wp -content / themes / nomedotheme / their categories files. In the example above , we have created two different templates for category 1 and category 65, but you can create those good wishes, simply put the category ID in the file name , and the stylization that you want . WordPress will read these templates before reading the category.php , differentiating them all to each other.