How to Add Content Templates in WordPress Post Editor
  • March 9

How to Add Content Templates in WordPress Post Editor

Learn how to easily move to the extended configuration templates display content with support for multiple columns in the layout and thus to save resources, time and do everything using a conventional WYSIWIG-Editor. This guide is suitable not only for beginners but also for advanced users who want to standardize and streamline work with the content of projects.

Create a display format of the content on the webpage in WordPress themes

All we need to do at this stage is to add a few elements in the HTML-editor and execute their style. The filter in WordPress default_content, the default, allows us to add a block specific content in any position immediately after its creation, that our customer does not have to do it yourself when setting up the theme. This filter is great for adding to the prepared text posts in WordPress themes. Add the code that you see below in the file functions.php, after which each new post, which we will create a blog or website will come with preloaded tags div, classes, content-col-main and content-side. Note that this code works correctly verified only for 3.0 versions in WordPress themes.
2-(6) <? php add_filter ('default_content', 'custom_editor_content'); function custom_editor_content ($ content) { $ content = ' <div class = "content-col-main"> This is your main page content & nbsp; </ div> <div class = "content-col-side"> This is your sidebar content & nbsp; </ div> & nbsp; & nbsp; '; return $ content; } ?> This basic pattern will appear each time you create a new post or page on your blog with WordPress templates. And so we now have a basic template with multiple columns, which is immediately displayed in the editor posts. You can return to the previous step and edit the file default_content and editor-styles.css, to get the visual style that you need - use this technique’s style setting to create your own design templates for content.

Working with external design in WooCommerce themes

When your posts are displayed on the website content yet still be "single column". Styles prescribed you a file editor-style.css, for the "front-end" do not fit. If you view the source code for the site pages, you will see that the div tags of the function custom_editor_content () only appear in them, as it were "wrapped" different content blocks. So just open the file style.css (or other style sheet file website for your WooCommerce template) and arrange as you wish:
  • Use JavaScript to indicate specific "containers", the task of dynamic effects and other options of registration;
  • In addition to the simple style settings, there are several opportunities for advanced design of your content on the site: it is necessary to use the creation of objects and access them using JavaScript.
A series of blocks of content can be converted into a series of "tabs" that the site administrator can group, move and update on a single page. This is just one of the many ways a simple management of content templates in WooCommerce themes.
3-(5) Why to create content templates for the page view for a single post? There are a lot of options. As for the static template pages, you can use different accounts (for example, records of different headings) to create your own content templates for WooCommerce themes. For example, to connect different Sidebars, add files to an additional output code of advertising banners. There are many different options. It is only necessary to include fantasy and think about how to extend the functionality of your site. And create templates for different accounts is a significant step in this direction. Ask your questions related to the use of WordPress themes and WooCommerce templates, by means of the user forum and the Tech Support of 8Theme.

Did you know ?

One standard license is valid only for 1 project. Running multiple projects on a single license is a copyright violation.

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.