How to create a blog template page in wordpress

Want to create a custom single post template in WordPress?

Custom single post templates allow you to use different layouts for your individual blog posts. Many WordPress themes come with a few different page templates, and you can also create your own if needed.

In this article, we’ll show you how to easily create custom unique post templates in WordPress. We will share several methods so you can choose the one that best suits your needs.

How to Create Custom Single Post Templates in WordPress

When do you need a custom single post template? ?

Sometimes you may want a different appearance for certain posts on your WordPress website. For example, you might want to use a different layout for featured articles or stories in a particular category.

This is where you need a custom single post template in WordPress.

So By default, WordPress uses the single post template based on the WordPress template hierarchy. All themes come with a single.php template, and this is used by default for all your individual posts.

Some themes may also include additional templates or layout options that you can use.

This is much like creating a custom page template. Most WordPress themes also come with page templates that you can use while editing a post or page in WordPress.

Choose a page template

That said, let’s take a look at how to easily create custom single post templates in WordPress. We’ll show you several methods, so you can use the one that works best for you.

  • Creating individual post templates with the block editor
  • Creating individual post templates templates using SeedProd
  • Using theme settings to create unique post layouts
  • Manually creating custom unique post templates with code
  • Creating custom unique post templates by category
  • Creating unique post templates customized for specific authors

Creating unique post templates using the block editor

This method it doesn’t actually create a post template and is limited in flexibility. However, it is the easiest way to save your own individual post layouts and then reuse them.

The default WordPress block editor comes with a built-in feature that allows you to save and reuse blocks. One such reusable block is the group block.

The group block allows you to put multiple blocks and entire post layouts in a group. You can then save this group block and reuse it in your other posts.

Let’s see how to use the group block to save your custom post templates.

First, you need to create a new post in WordPress. After that, simply add a group block to the content area.

Add Group Block

Now you can start adding blocks in the group block to create a unique post layout for your WordPress blog.

You can add any blocks you want including columns, media and text, cover images, and more.

Add blocks to group

Once you are happy with the layout you have created, you should raise your mouse and select the group block.

Simply click the three-dot menu icon and then select the ‘Add to Reusable Blocks’ option.

Add Reusable Block

Next, you need to provide a name for the reusable block and then click the button Keep. WordPress will now save your reusable block, including all blocks within the group block.

You can then edit any existing post on your website or create a new one. On the post editing screen, simply click the Add New Block button and find your saved block under the ‘Reusable’ tab.

Reuse Block

Add the block to your post and WordPress will upload your entire group block with all blocks and settings as you saved them.

This method allows you to save your custom layouts. However, it does not allow you to change the way your theme handles individual posts.

If you want more flexibility, continue reading the next step.

Creating Custom Post Templates Using SeedProd

The easiest way to create a custom single post template is by using SeedProd. It is the best WordPress website builder plugin and can create beautiful website designs and custom templates without writing any code.

You can use SeedProd’s drag and drop builder to create a completely custom WordPress theme, including custom unique post templates.

See Also:  How to create a silo in the directory of website

The first thing you need to do is install and activate the Seed production supplement. For more details, see our step-by-step guide on how to install a WordPress plugin.

After activation, you need to enter your license key. You can find this information in your account on the SeedProd website.

SeedProd License Key

After that, it’s time to create a custom WordPress theme. This is much simpler than it sounds.

Creating a Custom WordPress Theme

First, you need to head over to the SeedProd » Theme Builder page. Here, you’ll use one of SeedProd’s ready-made themes as a starting point. This will replace your existing WordPress theme with a new custom design.

You can do this by clicking the ‘Themes’ button.

Create your custom theme

You will be shown a list of professionally designed themes that are designed for different types of websites For example, there are templates called ‘Modern Business’, ‘Marketing Agency’ and ‘Mortgage Broker Theme’.

Take a look at the options and select the one that best suits your needs by clicking on the check mark icon .

Select a theme that match your needs

Once you’ve chosen a theme, SeedProd will generate all the theme templates you need, including one for individual pages and one for individual posts.

Each template comes configured with attractive layouts and placeholder content that’s easy to customize.

SeedProd Creates All the templates you need for your theme

For more information on creating a theme with Seed Prod, check out our guide on how to easily create a custom WordPress theme without any code.

Customizing the Default Single Post Template

SeedProd makes customization easy from the default ‘single post’ template using a drag and drop page builder.

Simply click the ‘Edit Layout ‘ link below the template. This will open your post template in SeedProd’s visual editor.

 Click

SeedProd’s visual editor has a 2 column layout. On the left, you’ll find blocks and sections that you can add to your layout. And on the right is a template preview where you can see your changes in real time.

SeedProd Visual Editor Blocks and Sections

It’s also easy to customize the design of your post template. Just click on any block to see its settings in the left column.

For example, if you click on the post title, you will be able to see its settings. You can now change the alignment, font size, heading level, and more.

Click a block to change its settings

Clicking the Advanced tab allows you to change font colors, spacing, and other styles.

You can add more blocks by dragging them from the left column to the preview column. SeedProd uses template tags to extract dynamic content like post titles, featured images, comments, and more. This allows you to add content to the template without having to edit each post individually.

For example, you can add a Posts block to the end of your post content. This will display recent posts that your visitors may want to read when they finish the current post. This block will automatically display on all posts that use this template.

Add a post block to the bottom of your individual post template

You can then change the post block settings to customize the content displayed.

For example, you can display content from specific categories, use a two-column layout, and change the number of posts displayed.

SeedProd Post Block Settings

Feel free to spend time experimenting with different blocks and exploring their settings.

After you’ve created something you’d like to use as your post template, it’s time to save it back. I click on the green ‘Save’ button in the upper right corner.After that, you can close the SeedProd visual editor by clicking the ‘X’ close icon.

When You

You can customize the rest of your WordPress theme in the same way. But if you need a little help, check back out our step-by-step guide on how to build a custom WordPress theme with SeedProd.

When you’re happy with how everything looks, make sure the ‘Enable’ switch SeedProd’s theme is in the on position. Your WordPress site will now use your SeedProd theme and custom single post template.

Enable SeedProd Theme

Using Theme Settings to Create Custom Unique Post Layouts

Many popular WordPress themes come with built-in settings for customize the appearance of your single post template.

See Also:  How To Build A Real-Time Commenting System

If your theme supports these settings, you can find them on the post editing screen. The available options may change depending on the theme you are using.

For example, the Astra theme offers customization options when editing a single post. With these options, you can change sidebars, hide headers, titles, menus, and more.

Astra Theme Single Post Template Customization

On the other hand, many of the top WordPress themes come with ready-made templates that you can use.

If your theme includes individual post templates, you’ll find them in the ‘Template’ or ‘Post Attributes’ panel while editing a post.

Choose a template when writing a single post

These templates are complete designs that you can use without configuration required.

Manually creating custom unique post templates with code

This method is a bit advanced as it requires you to edit files. os themes, copy and paste code, and optionally add custom CSS. If you haven’t done this before, check out our tutorial on how to copy and paste code in WordPress.

First, you need to open a plain text editor on your computer like Notepad and paste the following code inside :

This code defines a new template called ‘Featured Post’ and makes it available for post types, pages, and products.

You should save this file as wpb -single-post .php on your desktop. Next, you need to add the template to your WordPress site. To do this, you need to use an FTP client to upload the file to your current theme folder.

You can now log into your WordPress admin area and create or edit a post. Scroll down the post editing screen a bit and you’ll notice a new ‘Template’ panel or ‘Post Attributes’ meta box with an option to select the template.

Select your custom post template

You will see your custom ‘Featured Post’ template in the list there.

Right now, your template is essentially empty, so selecting it will simply show a blank screen.

Let’s fix this.

The easiest way to do this is to copy the code from your theme’s single.php file and use it as a starting point. You’ll need to open the single.php file and then copy everything after the get_header() line.

Next, you’ll need to paste this code at the bottom of your wpb-single-post.php file. You can now save this file and upload it back to your server.

However, it will look exactly the same as your current single post template. Now you can start making changes to your custom single post template.

You can add your own custom CSS classes, remove sidebars, create a full-width template, or whatever you like.

Creating Custom Single Post Templates by Category

Would you like to use a custom single post template based on categories? For example, you can give posts in the travel category a different layout than posts in the photography category.

You can do this using SeedProd’s theme builder or code.

Creating Custom Category Unique Post Templates Using SeedProd

We previously covered how to customize SeedProd Theme Builder’s default single post template. But it does not stop there. With SeedProd you can add as many custom post templates as you like, such as a different layout for each post category.

To add a new unique post template, simply click the ‘Duplicate’ link under the original post template. A new template called ‘Single Post – Copy’ will be created and added to the top of the theme templates page.

Create a new post template by duplicating the default post template

You can customize the new template the same way you previously customized the default single post template. Just click the template ‘ Edit the layout link and make any changes you want using SeedProd’s visual editor.

When you’re done customizing the template, you’ll need to add some conditions so SeedProd knows which posts should use this template In this case, we want it to display when viewing posts within a single category.

Click

You can do this by clicking the ‘Edit Conditions’ link in the template and a new window will appear.

See Also:  Configure ASP.NET Core to work with proxy servers and load balancers

Here you can give the template a name and priority.The default single post template has a priority of 0, so make sure to give this template a higher priority so it will show up in the matching ca.tegories.

Add template display conditions for a certain Category

In ‘Terms’, select ‘Has Category’ in the second dropdown, then type the category name in the last field – for example, if you only want posts in the Photography category to use this layout, type ‘Photography’.

When you’re done, click the ‘Save’ button and this template will now be used for all posts in the corresponding category.

This is the easiest way to create multiple custom post templates in WordPress. It doesn’t require any coding knowledge and you won’t accidentally mess up any theme files.

Creating unique custom post templates per category using code

This is another method for those who are comfortable adding code to their theme files.

First, you need to add this code to your theme’s functions.php file or to a code snippets plugin.

This code first checks if WordPress is requesting a single post. If so, it tells WordPress to look for the template in the /single/ folder of your WordPress theme.

Now you need to add template files defined by this code.

Login to your WordPress hosting using an FTP client or File Manager in cPanel and navigate to /wp-content/themes/your-theme-folder/.

Inside your current theme folder, you should create a new folder named ‘single’. Next you need to open this folder and create a new file inside it. Go ahead and name this file single-cat-{category-slug}. Replace {category-slug} with your actual category slug.

For example, if you have a category called ‘News’, then it will create the file single-cat-news.php. If you have a category called ‘Travel Tips’, create a template single-cat-travel-tips.php, and so on.

Creating single post template for categories

These template files will now be completely empty. As a starting point, you can copy the contents of your single.php file from your theme folder and paste it inside each of these templates. After that, you’ll need to edit these templates to make the desired changes.

Once you’re done, you can go to your website and view a post. You’ll use the template you created for the category this post is filed under.

Now suppose you have a post filed under two categories, News and Travel Tips. WordPress will automatically display the template for ‘News’ because it appears alphabetically first.

On the other hand, if you featured a post in a category and you didn’t create a template for that category, then WordPress will fall back to the single template. .php file of your theme.

Creating custom post templates unique to specific authors

Suppose you want posts written by a specific author to look different on your website. You can do this using code following the same technique we showed for categories.

First, you need to add this code to your theme’s functions.php file or a code snippets plugin.

Next you need to connect to your website using FTP or cPanel file manager in cPanel and then go to /wp-content/themes/your-theme-folder/. If you haven’t already created a folder called /single/ inside it, go ahead and create it now.

Inside this folder, you should create a template using the author’s username in the template name. For example, single-author-johnsmith.php.

This template will be empty, so you can copy and paste the content of the single.php template from your theme and use it as a starting point.

You can now visit your website to view a post created by a specific author. It will use the template you created.

We hope this article helped you learn how to create custom unique post templates in WordPress.You might also want to learn how to track website visitors to your WordPress site, or check out our list of must-have WordPress plugins to grow your site.

If you liked this article, subscribe to our YouTube channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

.

Leave a Reply

Your email address will not be published. Required fields are marked *