Product Documentations

Zonus

Create, Edit, Delete and use custom Content Template

You may first think why you need a custom content template. Let’s see the power of custom content template. It lets display the content of any post type in your desired way instead of the theme’s default way. For example, you can completely design the layout of your WordPress Single Post page without touching any theme’s core file. In short, you become a theme developer and design custom layout for displaying the content of each post type without touching any codes.

Creating a custom Content Template

With inLaw Theme and OneElementsPro plugin installed and activated on your site, you can create a custom dynamic content template using the most popular page builder Elementor. You can then use your custom content template on any post, page or archive. Let’s see how we can create a custom content template first.

Please follow the following step to create your first custom content template.

Step by Step guide:

Step 1. Go to Templates > Save Templates and click Add New.

Step 2. Choose page or Section in the template type. We recommend choosing the page type because you can use the elementor canvas template with page type in the elementor editor. Elementor canvas template gives you a completely white and clean layout where you can add content/widget and view your design nicely.

Step 3. Give your template a name like Custom Content template and then click Create Template button. You will see the elementor editor.

Step 4. Optionally, you can open page settings if you have selected page type in step 2 by clicking the cog/setting icon on the bottom left corner of the editor. Then select “Elementor Canvas” from the Page Layout dropdown. This will give you a clean layout to design your content template.

Step 5. Design your content template by dragging and dropping widgets from the left widget section. You can preview your design by clicking the Eye icon near the Green Publish button.

Step 6. Save your changes by clicking the green publish button.

Step 7. Again Go to Templates > Save Templates and hover over your newly added content template. And then click on the ‘Edit’ link. This time the template will appear in the WordPress default editor.

Step 8. Choose the Template Type as Content under the inLaw Template Type meta-box section. You can see the screenshot for more visual understanding. then update the template by clicking the update/publish button.

Using custom Content Template

Now it is time to use the custom content template you created above. inLaw theme provides the most flexible way to use a custom content template. Here is how. You can set custom content template 3 places and they have different priorities. Let me explain a bit. This is a very important concept. So, please make sure you understand this.

Suppose, you want to set the custom content template of WordPress’s default posts.

You can set a specific content template for each post by editing the post and choose a custom content template from the layout settings. This content template has the highest priority, it means it will be loaded over any other content templates set in any other places.

You can set a content template for ALL WordPress Default Post’s single/detailed page in the Dashboard > inLaw > theme options > Single > Post > Content section. This template has the second priority. It means if a single post does not have a content template set, then this template will be used.

You can set a content template for ALL WordPress Default Post’s and All Custom Post’s single/detailed page in the Dashboard > inLaw > theme options > General -> Single > Content section. This template has the third priority.

It means, the theme will try to load a content template in the post if it fails, then the theme will try to load a content template set in the theme options -> Single -> Post type name eg. Post. If it fails, then theme options -> General -> Single -> content template will be loaded finally. And if this content template also fails to load then the theme’s default content template will be the content template.

So, in short, the post content template has higher priority over Theme Options’ Single Content. Theme Options’ Single Content has higher priority over the Theme Option’s General Single Content.
For example. Post Content Template > Single Content Template > General Content Template > Theme Default Content Template.

Check the changes in effect

Visit your site after setting a content template. You should see your new content template has been loaded. You can use a custom content template for custom post types too in a similar way. For example, suppose you want to change the content template of the practice area. You can do that easily.

If you want to custom content template only in a specific practice area, then edit that specific practice area and set a content template in the custom layout section.
If you want to use a custom content template for all practice areas, then set a custom content template in inLaw > Theme Options > Single > Practice Area > Content Section.
If you want to use a custom content template for all single practice area as well as all single details page of all post types, then set a custom content template in inLaw -> Theme Options > General > Single page.

You can also change the content template for all the archives pages of all post types similarly.