Complete guide on how to build WordPress post templates - (r)

Sep 27, 2024
Creating WordPress post templates

-sidebar-toc>        -language-notice>

If you want to create unique content for your WordPress site, using custom post templates is a great method to make sure that every post published is distinctive. Templates like this save time, and also ensure consistency throughout your site.

This week, we'll explain how to do it with step-by-step instructions for creating customized WordPress post templates with each of these tools.

What exactly is an WordPress blog template?

A WordPress post template provides the predetermined layout and design which you can utilize to organize your blog posts. Instead of a traditional layout (or blank page) These templates provide a specific way for the posts to appear.

But if your content needs to be different from the traditional single-post template--that is, you would like to structure your content differently--you could create your own templates. Then, each time you're planning to write an article using the format, all you need do is choose that template, and the content will be structured according to the template. No inserting blocks or rearranging is necessary.

Post templates are beneficial for many reasons.

You can see, there are numerous benefits associated with creating your own post templates. These include:

  • Consistency. Post templates make sure that each article follows the same guidelines for style and makes your blog appear professional and unified. It doesn't matter what font type the header size or even the layout of your photos Templates ensure everything stays consistent.
  • Efficiency. With post templates, you can speed up the process of creating content by significantly. Instead of manually setting up the format for every new blog post, choose templates and concentrate on the writing. This is especially useful for businesses and bloggers who publish content frequently.
  • Better design. Templates allow for advanced customization and improved design without extensive coding skills. Tools like Block Editor and Elementor let you create attractive layouts that improve your readers' experience. They also let you keep them in mind for future and repeat use. For example, you can include dynamic widgets, custom headers and footers that are tailored to specific post types or groups.

Post templates help you save time. If you design your own templates, you will make sure that blog posts can be produced more quickly and are more interesting for visitors to your site. What are they employed for? We'll discuss that in the next section.

What could custom-designed templates for post use for?

Custom-designed templates for posts in WordPress offer a variety of options and let you to tailor your content's design. But without concrete examples, this can feel a bit abstract.

First of all, these templates cater to specific content types. The result is that each type of content becomes more appealing and appropriate to its purpose. You can, for instance, create custom post templates for:

  • Product reviews. Create templates to highlight the most important characteristics of the product, their pros and cons, and customer testimonials in an organized way.

Beyond post types and other types of content, you could also utilize templates to test different designs and layouts, as well as incorporate different design elements. So, you'll be able to use different templates if you're working on various content types, like the type of post that will require galleries in full or a review with comparison tables.

Here are a few commonly employed layout choices you could like to include in the templates you create:

  • Full-width layouts. Ideal for content that benefits by a large-scale appearance like cases studies or photography blogs.
  • Grid layouts. They are ideal for portfolios or eCommerce websites, they present multiple products in a tidy grid layout.
  • Custom headers and footers. Modify these elements to include specific info and navigation links. You can also add branding that matches the contents of the article.

The custom post templates will save you time while ensuring that each form of content is presented with the greatest efficiency feasible.

If you're now convinced about the benefits of custom-made post templates, let's look at how you can create these for yourself.

How to create a custom WordPress post template

We've already established that creating an individual WordPress post template can be a powerful way to ensure your content stands out, and that it meets your particular needs.

In this article in this article, we'll guide you through how to create custom templates for posts employing the following techniques:

  1. Block Editor
  2. Elementor
  3. Divi
  4. Code

Explore how you can improve your WordPress articles with custom-designed styles that can be reused often.

Method 1: Design customized post templates with the Block Editor

While you can create custom layouts using Blocks on the fly, creating unique templates for posts that you can reuse is more beneficial. That way, you don't have to build manually every post's layout prior to inserting your content. Select the template you want to use then click.

Step 1: Access the Template Editor

To begin, log to WordPress to gain access to the Dashboard.

Go to Appearance > Editoror Templates > Add New Template to make a brand new template.

Make a template new in the Block Editor.

Step 2: Choose the type of template you want to use.

Select the type of template you'd like to build like a single post, page or custom post type.

Select a post type for your new template.
Select a post type for your new template.

In this instance, we've selected a Post template.

Step 3: Design your custom template

The customization process follows the same procedure you would use to create a basic layout for your blog. Utilize the drag-and-drop feature to include blocks like headers and footers, text images, and other content elements. The design should appear precisely how you'd like it to.

This example has created blocks that form a template for describing a workflow process. That is a page in which you describe what prospective clients could expect when working together on a task.

Creating a new Block Editor template is as easy as a drag-and-drop.
Making a brand new Block Editor Template is just as easy as dropping a file.

This template has included blocks for a headline, a three-column container to add images or text as well as a timeline for detailing the working process and a call to action block on the bottom.

After your template design is completed, click Save in the upper right-hand corner.

Save your work when you’re done making changes. 
Keep your work in a safe place until you've finished making modifications.

Step 4: Use the latest template within the post

To apply the template to a post, open a post using the Block Editor and navigate through the Post Settings sidebar. There, you'll find the option to apply single posts because that's the default post template within The Twenty Twenty-Four theme.

Click this, and new options will appear. Click here to on Swap Template.

Swap out the default template for your custom one. 
Change the default template to create your own template.

Choose your personal template on the next screen.

Select the custom template and start editing. 
Select the custom template and start editing.

Pros and cons of making use of the Block Editor

This procedure is very simple and offers many benefits. But it does carry some drawbacks too. Let's explore the two sides of this coin now.

    Pros:    

  • Simplicity. The Block Editor's user-friendly interface makes it accessible to everybody regardless of skill level. Creating and modifying templates is easy with drag-and drop feature. And there are no extra tools required - just the most current WordPress installation.
  • Efficiency. Blocks that can be reused and the capability to save templates streamline the content creation process making it faster and more efficient, while also making sure that content is consistent across all content.

    Cons:    

  • Limited customizable. Although the Block Editor is great for simple customization, it might not provide the options that some users require. For more complex designs, plugins, or custom coding might be needed.

Using using the Block Editor to design customized templates for posts is an effective method to improve the look of your WordPress site's design without needing to be able to program. However, if you want greater flexibility, looking into the possibilities of using tools such as page builders or the possibility of customizing your code could prove beneficial. Let's discuss those next.

Method 2: Create custom post templates using Elementor

Let's walk through this process.

Step 1. Install and activate Elementor

Go to your WordPress dashboard, and then install the Elementor plugin. For this you need to go to plugins > add new Pluginthen search for "Elementor." The plugin should appear as the initial page that you search for.

Select the Install button, then Activate.

You'll require the premium version of the plugin in order to make custom templates for your posts.

Step 2: Access the builder template

After the installation is complete Once the installation is completed, head to Elementor > Templates > Add New.

Choose template type in Elementor.
Choose template type in Elementor.

Select single post as the template type. After that, you can provide your template with a title and then click Create Template.

Step 3: Customize the layout

Customize the template in Elementor. 
You can customize the template within Elementor.

You are able to insert and arrange different post elements using an editor that drags and drops. The most common templates for posts comprise Post Title, Post Content Post Content, the Featured Image, Post Excerpt, Post Meta, and Author Box.

However, you are able to choose which best suits your needs. Customize each element's settings to fit your design needs. In particular, you could alter the font, color, and spacing in the Style tab for each component.

You can adjust the style of each element you add to your post template.
You can adjust the style of each element you add to your post template.

Think about adding dynamic elements, such as Commentaries, Related Posts and Social Share Buttons as well.

Step 4. Implement the template in the post

When you're satisfied with the design, click after which you can click.

Elementor will prompt you to set conditions for the instances in which this template can use. It can be applied to all posts, posts that are in particular categories, or posts by specific authors, or individual blog posts.

The pros and cons of Elementor Elementor

Elementor generally makes creating post templates simple. As with Block Editor it also has many positive and negative points.

    Pros    

  • Advanced personalization. Elementor gives you a lot of design freedom. It allows you to create more intricate layouts and unique designs that aren't achievable with the default Block Editor.
  • It is simple to operate. Drag-and-drop is easy to use. It is easy to drag and drop components to the place you wish the elements to be. The real-time view makes the process of designing easy and also.
  • Content that is dynamic. Elementor allows you to add dynamic content which can be useful for those who want posts to update automatically with new material.

    Cons    

  • Difficulty. Although Elementor is easy to use however, the number of choices and settings could make it difficult for novices. There's a certain process of learning to use the capabilities.
  • Performance concerns. Using too many elements can sometimes impact page load times. So you'll need to take care not to overload it to avoid affect the performance of your website.

Elementor is an ideal choice for creating highly customized WordPress template posts. Its sophisticated features let users to create templates that look great and improve the user experience.

Method 3: Create custom post templates using Divi

Step 1: Go to the Divi Theme Builder

For this to work, you will need to purchase Divi. Assuming that you've bought Divi and the Divi Builder Plugin, you are able to install it as like any other premium option. Just go to your WordPress dashboard and click Themes > Appearance, and then Add New Theme. Then select your Divi .zip file and upload it to your site. Then click Install.

When this step is complete, go to Divi Theme Builder.

Access the Divi Theme Builder. 
You can access to Divi Theme Builder.

Click on the Add New Template, then Build New Template to make an entirely new template.

Step 2: Modify templates settings.

In the Template Settings, pick the place you'd like to your template to be used. Since we're creating a post template then you'll need to pick one which is located under the Posts section.

You can select where you'd like your new template to be used immediately.
You can select where you'd like your new template to be used right away.

In this case, we've selected blog.

After that, click Add Custom Body and then choose to build a custom body..

Select Add Custom Body to start designing your post template.
Choose Add Custom Body to start making your own post templates.

Step 3: Customize the layout using Divi Modules

Design your post template with the Divi Builder. Then, use Divi Modules built into the program to create your desired layout.

Selecting the Post Title Module to add to a post template in the official Divi documentation.
The Post Title Module is the one you choose to be added to a template of a blog within the Divi documentation. Divi document.

Divi provides a variety of options to alter your template like Post Title, Post Content Post Excerpt and Post Meta and comments.

You can also use any alternatives to create the style and performance you're looking for.

It is also possible to add dynamic content like authors and related posts to ensure that the template's capabilities are closer to a traditional Post template.

Step 4: Save and apply the template

When your design template is complete, save it by clicking to the Save button within the Divi Builder.

To apply the template to your blog posts, you must make sure you set the display parameters in the Theme Builder settings. The option is to apply the template to all posts, particular categories, tags, or individual post.

Cons and pros of using Divi

Working with Divi to create custom post templates is pretty straightforward. It offers a clean interface we quite enjoy. As with all the methods we've discussed today, there's some bad along with some great.

    Pros    

  • High-level of customization. Divi has a wide range of customizable options to create unique post templates. The wide variety of options and settings for design allows you to fully control your template's design.
  • Simple interface. The editor's visual layout is easy to use and makes it easy to design intricate layouts. Real-time previews help you see precisely how your layout appears at the top of the page.

    Cons    

  • Dependence on the Theme Builder. The Divi Theme Builder means you are bound to the theme's plugin. Though you can make use of Divi Builder Divi Builder plugin separately from the theme, it could be a bit restrictive to venture outside the bounds of this.
  • Too many options. While Divi is powerful, it can be overwhelming for beginners. Yes, it's all easy to navigate, but it means you'll quickly become overwhelmed by the choices. A lot of possibilities could be paralyzing.

Divi is another option to create custom WordPress template for posts. However, if you're in search of high-end customization, manual programming will always be the way to go at.

Method 4: Create posts templates that are custom designed with codes

Step 1. Create a child theme

In your WordPress directory, click the wp-content/themes directory and create a separate folder for your child theme. It's something such as mytheme-child is sufficient.

Inside this folder, create the style.css file and an functions.php file.

Within style.css, add the following header to connect it to the theme's parent theme:

/*
 Theme Name: My Theme Child
 Theme URI: http://example.com/my-theme-child
 Description: My Theme Child Theme
 Author: Your Name
 Author URI: http://example.com
 Template: mytheme
 Version: 
 */
 
 In functions.php, enqueue the parent theme's styles:
 
 

Once you've made these files, go to your WordPress dashboard, and click Appearance > Themes. Your new child theme should be displayed in the list. You can activate the theme just like you would with any other.

2. Add a new template file

Within your child theme folder, create a new file named single-custom.php. This file will serve as your custom post template. Begin by adding the template header.

3. Modify the template by using HTML, CSS, and PHP

You can now customize the single-custom.php file to create your own layout for your blog. Utilize HTML and CSS for the style and structure of the post and PHP to dynamically fetch posts' content.

Here's a brief example of what customization can be:

  
 
 Published on: 
 by 
 
 
 
the_content();?
It is
It isThe post-wrapper .post-wrapper Max-width: 800px; Margin: 0 Auto; Background: #f.post-meta Font-size 14px; Color #555; 

4. Use the template from the Post Editor

For a customized template, simply open a post in your WordPress editor.

On the Post Settings sidebar, find the Template dropdown menu. Just as you did when creating a template with the Block Editor Click the name of the currently selected template (likely Single Posts) and click Switch Template. Your new template should be displayed in the popup.

Click it, and this applies the single-custom.php template you recently created to your article.

Pros and cons of custom coding a post template

This last method involves coding to create a post template This is more complicated, however it can provide real benefits.

    Pros    

  • Complete control. Custom-coded code gives you complete control over the design and features of your post templates. You can add any feature or design without limitations.
  • Total versatility. You can create highly specific designs and functions that meet the exact needs of your business. There are no compromises to be made. This allows you to be able to create precisely the sort of site you want.

    Cons    

  • Complexity. Customized programming requires a thorough understanding in HTML, CSS, and PHP. It's a real problem for people who don't have prior experience with coding.
  • Maintenance. The templates that have been manually coded are harder to maintain and update. If your theme's parent theme or WordPress itself is updated then you might need to manually adjust your custom templates to make sure they are compatible.

The manual creation of custom post templates provides unmatched freedom and control. So if you need an incredibly customized solution this should be your go-to. If you don't have any programming experience, another approach would be the best.

Tips for creating effective blog post templates

Making effective WordPress post templates can ensure consistency across all of your content, without the need create a new look every time you create a post. Additionally, it allows possibilities in the options you have to add as well as the experience users are able to provide.

No matter which approach you choose, however it is important to remember the following tips to keep in mind when you're developing your post template:

Make use of a child theme if it is appropriate

If you're using the Block Editor or a page builder software, you might be able to do free of this step, as there are built-in template-making features. It's nevertheless a great practice.

Keep the design friendly for the user

Focus on creating a clean, intuitive design that enhances the readability as well as navigation. Make sure the essential elements, such as pictures, headings and buttons for call-to-action are readily accessible.

The user-friendly design makes it simpler for site visitors to navigate your site, read your content, and fill out your CTAs. Yes, you can design any layout you like However, ensure that you follow the design the best practices.

The trends in design change, so it's essential to update your templates to keep a contemporary and professional design. Regularly review and update your templates for posts to reflect new trends in design and still adhere to your overall brand design. Being current can help maintain the appeal and efficiency of your site, too.

Get a good idea of what it is that the template will be employed for.

Before designing a template be clear about the purpose of your template. Different types of content require various design styles. A product review might need sections that include the pros and cons, reviews and descriptions in detail, while blog posts could concentrate more on readingability and graphic elements.

Knowing what the intended use is will ensure that the template fulfills its purpose.

Maintain access

Every template for your blog is required to be accessible for all users, including disabled users. Use proper HTML tags, add alt text for images, and make sure your website is accessible via keyboard. Additionally, make sure you have enough colors in your design and stick to using readable fonts.

Enjoy true personalization by designing your own custom post templates

The ability to create custom templates for posts within WordPress allows you to have complete control over the site design and the process of creating content. Be it the Block Editor or Elementor Divi or custom-code, each method offers unique benefits and caters to different abilities and requirements. If you're not sure which one you should choose, play with these methods to find the best fit for your site's needs, expertise degree, and requirements.

Jeremy Holcombe

Senior Editor at WordPress Web Developer, and Content Writer. In addition to all things WordPress, I enjoy the ocean, golf as well as movies. Also, I have height issues.