Give Explicit individual Posts a Unique Style with WordPress Custom designed Post Templates

by | Aug 4, 2026 | Etcetera | 0 comments

With the arrival of building types in WordPress, the ability to put up “Hyperlink” posts or “Gallery” posts , and a variety of others. turn into one thing you need to do out of the sphere.

Alternatively for individuals who’ve ever sought after to offer other posts a technique of your own, there are a pair techniques to perform this—with reasonably of customized coding, or by way of the use of a plugin.

We’ll take a look at each on this post.

Continue to learn, or use the hyperlinks underneath to leap to any segment:

First up, let’s…

Create A Customized Publish Template With Code

1. It’s a good suggestion to keep a copy of your web internet website ahead of fiddling with data and code, so move forward and do a snappy backup now.

A superb host will perhaps have a integrated backup function that you’ll be able to avail your self of. If you host with WPMUDEV, you’ll be able to run a snappy backup by the use of The HUB. Alternately, you need to use a plugin (we propose Snapshot Professional).

Backup files in the Hub
Push-of-a-button backups by the use of WMUDEV’s The Hub Interface.

2. Get entry to your WordPress web internet website data, every by yourself server, or by the use of your host get entry to level.

See also  Easy methods to Generate Barcodes in Google Sheets
The Hub, view-edit files
Having access to WP web internet website data by the use of WPMUDEV’s Hub is a swift, streamlined enjoy.

3. Navigate to: Wisdom > wp-content > topics > twentytwenty (or without reference to theme you’ll be the use of)… and find the unmarried.php or singular.php document.

4. Keep a copy of this document, then rename it. I’m going to name mine: jbtest.php.

Duplicate & rename a php file in WP
Emerging and adorning a php document in WordPress.

5. Now we want to transfer this document into the templates subfolder (underneath twentytwenty).

You’ll word that the guidelines already populated listed here are preceded by way of “template–”, so we’ll rename the document over again to check that conference, making mine: template-jbtest.php.

Creating and editing a php file in WordPress.
That is how the folder and data take a look at this level.

Now that the document is referred to as appropriately and in the right kind folder, we want to edit the contents so it’s coded as a template.

6. Move into improving mode (right-click the document, and choose Edit textual content), and at the easiest of the code, upload the next:

<?php
/*
* Template Determine: JBTest
* Template Publish Sort: post, web internet web page
*/
?>

Pasting the template code into the PHP file.

The place the code reads “Template Determine Posts: JBTest”, use without reference to identify you prefer (instead of JBTest).

Word: Ensure that each line of this easiest level code is by itself row. (It is going to need to show in one line while you paste it.)

7. Industry the remainder of the document in without reference to approach you prefer, to make it your own. Remember to click on on on “Save & Shut” after finishing the edit.

Insert test text php file
I added some random “trying out” textual content additional underneath, as a visible validation that the code labored.

Create a New Publish The usage of a Template

Let’s create a brand new post, so we will take a look at out the template we simply made.

See also  Divi 5 Replace: Public Alpha Model 2

1. From the WordPress dashboard, create a New Publish.

2. In the right kind aspect menu, you will have to see a column referred to as “Publish Attributes”, with the header “Template” underneath it.

3. Click on on on at the Template dropdown menu to look the various templates to be had. Your new template can also be indexed there as you named it, so move forward and make a selection it!

New Template type in dropdown menu of Post Editor
Create your post and put it aside, or just save and preview to get a take a look at it.
Preview of post made with custom template
Preview of a New Publish made with my customized template.

There’s my “take a look at” message. It’s now not very lovely, then again that’s simply mounted by way of formatting, harking back to along with padding, converting font type, taste, colour, and a variety of others. The crucial factor is, it indisputably did what we would possibly have preferred!

Now, let’s take a look at the plugin approach.

Create a Customized Publish Template with a Plugin

If you don’t want to contact any code, you’ll be able to come to a decision to move the plugin trail. On this instance, we’re going to make use of the Customized Layouts plugin.

Head to the WP plugin repository to get the Customized Layouts plugin.

Custom Layouts plugin
Customized Layouts plugin.

2. After setting up and activating the plugin, you’ll see its menu right through the dashboard. Click on on on on Templates, then the Upload New Template button.

Custom Layouts plugin, add a template
Customized Layouts plugin, upload a template.

3. This may occasionally most likely every so often open the Template improving mode, which works with Gutenberg blocks by the use of the left aspect of the display.

You’ll paintings from the Template or Part tabs, in the market at the appropriate aspect of the display. Remember to identify your template, and put it aside when entire.

See also  4 Issues Content material Entrepreneurs Can Be informed From HubSpot’s Creators
Custom Layouts plugin, Template editing mode.
Customized Layouts plugin, Template improving mode.

4. You’ll save this as a template for any long term posts, or use the shortcode (furthest appropriate aspect panel in improving mode) to show a unmarried example of the template.

In case you wish to have, you’ll be able to paintings from the Layouts menu, which permits for simple setup of grid type posts. The entirety you do suitable correct right here will also be stored as a template for long term use, or by way of the use of shortcode to show the format.

Custom Layouts plugin, Layout editing mode.
Customized Layouts plugin, Structure improving mode.

5. You’ll View, Edit, or Delete Templates or Layouts at any time from the dashboard plugin submenus.

Custom Layouts plugin, saved templates list.
Customized Layouts plugin, stored templates checklist.

Publish-it Notes

There you have got it… two reasonably rapid and simple techniques to offer particular person posts a singular taste.

For those who specifically revel in DIY, take a look at this in-depth article at the weblog, Growing Customized Content material in WordPress: Customized Put up Sorts.

Editor’s Word: This post has been up to date for accuracy and relevancy.
[Originally Published: November 2011 / Revised: April 2022]

WordPress Developers

[ continue ]

WordPress Maintenance Plans | WordPress Hosting

read more

0 Comments

Submit a Comment

DON'T LET YOUR WEBSITE GET DESTROYED BY HACKERS!

Get your FREE copy of our Cyber Security for WordPress® whitepaper.

You'll also get exclusive access to discounts that are only found at the bottom of our WP CyberSec whitepaper.

You have Successfully Subscribed!