A Content Template lets you control the content part of WordPress posts, pages, and custom post types. Normally, these pages include a header, sidebar(s), menu, title and footer. Of all these, the Content Template is responsible for the content part.

This image illustrates it:

Different sections that make up a WordPress page

The Content Template will fill the content part in this picture. With a Content Template, you can display static text, HTML and any field that this content type includes. The end result can be something like this:

Complete Content Template using custom fields

Adding Static Text, HTML, and Fields

When you create a new Content Template, you’re going to see a page like this:

Add new Content template screen
Add new Content template screen

Enter your content in the template part of the page. You can also add custom CSS and JavaScript, in order to customize your template further. Views will render them on your page footer every time this Content Template is used.

You can organize the output of your content template into columns, by using the Grid button.

Here is the Content Template meta HTML that produces the showcase example above:

Showcase meta html
<div class="info">
	[types field="url" title="Visit site" class="visit-site"]
	<div class="section">Rating</div>
	<p>How do you like this site. Rate it based on their design, originality and overall appeal.</p>
	<div class="section">Category</div>
	<p>[wpv-post-taxonomy type='showcase-category' separator=', ']</p>
[types field="image" size="full" align="none"]
<div class="post-body">
	[wpv-post-body view_template='None']

The code starts with <div class="info">. This will wrap the button to visit site and stars rating.

Then, the Content Template displays the image field and finally, the post’s body, inside a div called post-body.

You don’t need to memorize these different shortcodes in order to insert them. Click on Field and Views to insert all the fields that are available for the content type that uses this Content Template:

Adding fields shortcodes from Fields and Views button
Adding fields shortcodes from Fields and Views button

The different fields are arranged under sections, to make it easier for you to find them. You’ll see:

  • Basic – this section always appears. It includes the standard fields that exist in any WordPress content, like body, title and URL.
  • Taxonomy – if this content uses taxonomy, it will appear as well.
  • Content Templates – you can insert other Content Templates
  • Custom fields – you’ll see a section for each content type. Under it will appear the different custom fields that can appear for that content.
  • Views – if you’ve created Views, you’ll see them under the Views section.

The dialog from Fields and Views button includes a search box. This might be your fastest route to locating fields. As you type in the search, the results will update to filter only the matching fields.

Toolset provides seamless integration with third-party page builders, so you can easily design templates for your content. Currently, only Visual Composer is being supported, but more integrations will come soon.

Template Usage

Just after the Content Template editor, there is a Usage section. In this section, you can choose which elements will use this template. You can select between the post types (posts, pages, custom posts types), post archives and taxonomies archives.

Content Template Usage
Content Template Usage

Οutput mode

On the bottom part of the Content Template edit page, you’ll see an Output mode section. There, you can control if this Content Template uses the normal WordPress output processing – Auto-insert paragraphs, or raw output – Manual paragraphs.

Automatic or manual paragraphs
Automatic or manual paragraphs

By default,  WordPress adds paragraphs and line breaks automatically. For example, if you write:

Auto paragraph text
This is line #1

This is line #2

You’ll get this HTML output:

Auto paragraph html
<p>This is line #1</p>
<p>This is line #2</p>

Most of the times, these automatic paragraph and line-breaks are convenient and you’ll want to use this mode. However, sometimes they make your HTML output difficult to control. For example, if you’re creating an HTML form, you don’t want WordPress to insert <p> elements around <input> elements.

In this case, use the Manual paragraphs option. Then, Views disables the normal WordPress processing and outputs only the HTML markup that you’ve written, without any further processing.