Custom one-page templates give you more flexibility and creative control in website design, especially for content-rich websites such as blog pages, product showcase pages, or service detail pages. In this article, we'll walk through how to create a custom one-page template using Elementor's Flexbox container feature with specific examples throughout the article.
![图片[1]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121144641536-image.png)
What is a one-page template?
Single page templates is a custom layout file used in WordPress for a single piece of content such as a blog post or product page. It replaces the theme's single.php
maybe singular.php
Documentation.
Example:
Let's say you're running a blog site and want toEach article pageAll contain the following:
- The header section displays the post title and share buttons.
- The body section displays the article content and accompanying images.
- The right sidebar displays related articles or advertisements.
This can be easily achieved with a one-page template.
Why choose Flexbox containers?
![图片[2]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121144746191-image.png)
The Flexbox container is a modern layout tool provided by Elementor that is more flexible than traditional section and column layouts. Here are its main advantages:
- dexterity: Easily implement horizontal or vertical layouts to accommodate different screen sizes.
- Responsive Support: Performs consistently on mobile and desktop without additional tweaking.
- performance optimization: Reduced DOM hierarchy for faster page loads.
Steps to create a custom one-page template (inblog page(as an example)
The following steps will explain how to create a one-page template from scratch, using the example of designing a blog post page.
Step 1: Create a new template
- Log in to your WordPress dashboard and navigate to Templates > Theme BuilderThe
![图片[3]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121113639475-image.png)
- strike (on the keyboard) single pageand then select + Add new templateThe
![图片[4]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121113752132-image.png)
- Close the Template Library popup and go to Elementor's Blank Canvas Editor.
![图片[5]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121113916729-image.png)
Step 2: Create the Header Section
1. Add title container
strike (on the keyboard) + Icon Create a new Flexbox container and select Single Row Layout.
- height: Set to
Boxed
The content is centered.
![图片[6]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121134808510-image.png)
- minimum height: Set to
100px
Make sure the header area is prominent enough. - alignment: Set content alignment to "spacing".Make the title and share buttons distributed on both ends of the containerThe
![图片[7]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121134742343-image.png)
2. Adding a title widget
From the Elementor panel, set the Post Title Widget Drag and drop into the container. This will dynamically display the title of the current page.
![图片[8]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121135020459-image.png)
- Configure title settings:
- Title: By default, the current article title will be displayed dynamically without additional modification.
- HTML Tag: Set to H1to ensure that the title is in line with SEO best practices.
- Link: If you need to have the title link to the current post, you can do so in the Link Select "Dynamic -> Post URL".
![图片[9]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121135501941-image.png)
3. Add sharing buttons
commander-in-chief (military) Share Button Widget Drag and drop to the right of the header to configure social platforms such as Facebook, Twitter, etc.
![图片[10]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121140110928-image.png)
and adjust the button style:
- Set button rounded corners to modernize the design.
![图片[11]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121140247183-image.png)
- Resize buttons to make them easy to click on both desktop and mobile.
![图片[12]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121140457579-image.png)
Instance effects:
When a user opens a particular blog post, the post title and share buttons are displayed at the top, making it easy for users to quickly share the content.
Step 3: Create Body and Sidebar Layouts
1. Creating a two-column layout
strike (on the keyboard) + Icon Create a new Flexbox container and choose a two-column layout.
- The left container is used to display the body content.
- The right container is used to display sidebar content.
![图片[13]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121140719795-image.png)
2. Configuration width
- Left-hand container: Set the width to
75%
, focusing on displaying the body of the text. - Right-hand container: Set the width to
25%
, as a display area for supporting information.
![图片[14]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121140901389-image.png)
Step 4: Add body content
1. Add post content to the left container
commander-in-chief (military) Post Content Widget Drag and drop into the left-hand container. This will dynamically populate the body content of the current page, such as the text and images of the article.
![图片[15]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121140953827-image.png)
2. Adding supporting functions
- Example 1: Links to related articles
At the bottom of the text add Embedded widgetsThe following are some examples of how to do this: - Display the titles of 3 related articles dynamically, for example:
![图片[16]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121141302475-image.png)
![图片[17]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121141347617-image.png)
- Example 2: Comment Area
Use the WordPress default comment widget or a third-party plugin to integrate comment functionality into the body area.
![图片[18]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121141552752-image.png)
![图片[19]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121141643566-image.png)
Step 5: Add Sidebar Content
1. Add catalog widget
![图片[20]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121142025871-image.png)
commander-in-chief (military) Catalog Widget Drag and drop into the right-hand container and set the heading levels (e.g. H2 and H3)
![图片[21]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121142113547-image.png)
2. Adding other widgets
- Call to Action Button: Add a subscribe button at the bottom of the catalog.
![图片[22]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121142349862-image.png)
- advertising position: Use Image Widget to place advertisement images, recommended courses or tools.
Step 6: Optimize Responsive Design
- Switch to the mobile view in the Elementor editor and adjust the layout:
- Set the sidebar width to 100% so that it stacks below the body content.
![图片[23]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121142729599-image.png)
- Adjust headline and body text font sizes to make them clearer and easier to read on small-screen devices.
![图片[24]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121142837533-image.png)
Example:
On mobile, the Table of Contents widget will be displayed below the body content while keeping all links clickable.
![图片[25]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121142858452-image.png)
Step 7: Set display conditions and save
- Click on the upper right corner of the post button to set the display conditions:
- Apply the template to all blog post pages.
- It can also be applied only to specific categories of articles if desired.
![图片[26]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121143242889-image.png)
- Save the template and preview the effect.
Example results: blog post page template
The above steps will result in a complete blog post page template with the following elements:
- Post title and share buttons at the top of the page.
- The main area displays body content with related article recommendations and comments.
- The right sidebar contains a table of contents and advertisement spaces for easy user navigation and interaction.
![图片[27]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121143342886-image.png)
![图片[28]-如何使用 Elementor Flexbox 创建自定义单页模板 | 全面教程](https://www.361sale.com/wp-content/uploads/2024/11/20241121143410510-image.png)
Summary:
Using Elementor's Flexbox container, it's easy to create custom one-page templates for blog posts, product pages or service detail pages. Go through the detailed setup steps, including header area, body and sidebar layout, as well as catalog andcall to actionFlexbox's powerful features support responsive layout to optimize user experience, while simplifying the DOM hierarchy to improve page loading speed.
Link to this article:https://www.361sale.com/en/27358The article is copyrighted and must be reproduced with attribution.
No comments