{"id":1621091,"date":"2020-05-12T09:25:30","date_gmt":"2020-05-12T09:25:30","guid":{"rendered":"https:\/\/toolset.com\/?post_type=course-lesson&#038;p=1621091"},"modified":"2021-05-18T14:59:46","modified_gmt":"2021-05-18T14:59:46","slug":"creating-templates-to-display-custom-posts","status":"publish","type":"course-lesson","link":"https:\/\/toolset.com\/es\/course-lesson\/creating-templates-to-display-custom-posts\/","title":{"rendered":"Creating Templates to Display Custom Posts"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">What&#8217;s a Template?<\/h2>\n\n\n\n<p>A template is something that you design once and it controls the way a &#8220;group of posts&#8221; appear on the site&#8217;s front-end. Toolset&#8217;s templates work similarly to the WordPress PHP templates, but you design them visually through the editor without having to edit any files or write any code. The templates that you design with Toolset can include fields, taxonomy, related posts and anything else coming from the WordPress database.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Design Templates<\/h2>\n\n\n\n<p>To build a template, you insert fields, arrange them in any custom layout of your choice, and design how to display them on the front-end.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Go to <strong>Toolset <\/strong>\u2192 <strong>Dashboard <\/strong>and click the <strong>Create Content Template<\/strong> button in the row of the post type you want to design a <a href=\"https:\/\/toolset.com\/glossary\/template\/\">template<\/a> for.<\/li><li>Use the WordPress Block Editor to design your template.<\/li><li>Choose blocks from the <strong>Toolset <\/strong>section for any part of the template that displays <a href=\"https:\/\/toolset.com\/glossary\/custom-fields\/\">fields<\/a> (not static elements). For example, use Toolset\u2019s Heading block for any heading that will display a field.<\/li><li>Enable <strong>Dynamic Sources<\/strong> for blocks that should display fields of the post that the template displays.<\/li><\/ol>\n\n\n\n<p>Here&#8217;s an example of displaying the post title in a template for single &#8220;property&#8221; posts on a Real Estate site.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"d8aa73d0d8a9e4b465ff43a360511946\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/11\/toolset-content-template-displaying-dynamic-sources-1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/11\/toolset-content-template-displaying-dynamic-sources-1-500x227.png\" alt=\"\" class=\"wp-image-1859093\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Displaying the post&#8217;s title <\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<p>That&#8217;s it, now you can further tweak your template. For example, you can arrange content in columns, use containers, display parts of the template conditionally, display a list of related posts, create responsive designs, and more.<\/p>\n","protected":false},"author":4341,"featured_media":1625887,"template":"","related-lesson":[8427],"class_list":["post-1621091","course-lesson","type-course-lesson","status-publish","has-post-thumbnail","hentry","related-lesson-post-templates"],"_links":{"self":[{"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/course-lesson\/1621091","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/course-lesson"}],"about":[{"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/types\/course-lesson"}],"author":[{"embeddable":true,"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/users\/4341"}],"version-history":[{"count":8,"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/course-lesson\/1621091\/revisions"}],"predecessor-version":[{"id":2060041,"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/course-lesson\/1621091\/revisions\/2060041"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/media\/1625887"}],"wp:attachment":[{"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/media?parent=1621091"}],"wp:term":[{"taxonomy":"related-lesson","embeddable":true,"href":"https:\/\/toolset.com\/es\/wp-json\/wp\/v2\/related-lesson?post=1621091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}