{"id":7783,"date":"0204-03-31T02:35:59","date_gmt":"1973-07-28T19:43:27","guid":{"rendered":"http:\/\/info.template-help.com\/?p=7783"},"modified":"2017-12-22T09:42:33","modified_gmt":"2017-12-22T14:42:33","slug":"how-to-create-page-templates","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/how-to-create-page-templates.html","title":{"rendered":"WordPress. How to create page templates"},"content":{"rendered":"<p>\r\n<\/p>\r\n<p>This tutorial is going to show you how to add new page templates to your WordPress Cherry Framework template.<\/p>\r\n<p><a href=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/0204\/03\/watch?v=02VnBHwd3ZY?width=1280&amp;height=720\" rel=\"prettyPhoto\">WordPress. How to create page templates<\/a><\/p>\r\n<ol>\r\n<li>\r\n<p>Log into your WordPress admin panel.<\/p>\r\n<\/li>\r\n<li>\r\n<p>Go to\u00a0 the <strong>Pages  -&gt; Add New<\/strong> menu to create a new page with a new page template.<\/p>\r\n<\/li>\r\n<li>\r\n<p>Give your new page a title and save it. In the <strong>Page Attributes<\/strong> panel on  the right, you can select a page template from those already\u00a0 included into the template. You need to add a  new one to this list. All these page templates are located in the <strong>wp-content\/themes\/CherryFramework<\/strong> folder on your FTP. But you will need\u00a0 to  add a new page template in the <strong>wp-content\/themes\/theme##### <\/strong>\u00a0folder on your FTP.<\/p>\r\n<\/li>\r\n<li>\r\n<p>Create a new\u00a0 file in any .php editor like Dreamweaver or  Notepad++ and\u00a0 give it a name, e.g.\u00a0<strong><em>new.php<\/em><\/strong>. Add the following content to it:<\/p>\r\n<pre class=\"brush:php\">\r\n&lt;?php\r\n    \/*\r\n    Template Name: Custom\r\n    *\/\r\n?&gt;\r\n<\/pre>\r\n<\/li>\r\n<li>\r\n<p>Save the file and upload it to\u00a0the <strong>wp-content\/themes\/theme##### <\/strong>\u00a0folder on your FTP.<\/p>\r\n<\/li>\r\n<li>\r\n<p>Go\u00a0  back to the page you created in WordPress. In the <strong>Page Attributes<\/strong> panel, you can select the new page template called  &ldquo;Custom&rdquo;.<\/p>\r\n<p><a href=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/0204\/03\/wordpress_cherry_new_page_template_adding_1.jpg\"><img loading=\"lazy\" src=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/0204\/03\/wordpress_cherry_new_page_template_adding_1-224x3001.jpg\" alt=\"wordpress_cherry_new_page_template_adding_1\" width=\"224\" height=\"300\" class=\"aligncenter size-medium wp-image-33940\" \/><\/a><\/p>\r\n<\/li>\r\n<li>\r\n<p>Click <strong>Publish<\/strong>. Then click <strong>Preview  Changes<\/strong>. The page will be completely blank.<\/p>\r\n<\/li>\r\n<li>\r\n<p>Go back to your new.php file to  start adding\u00a0 your content.\u00a0 The file may contain anything you need  including some static content or some markup that will determine your page  content.<\/p>\r\n<\/li>\r\n<li>\r\n<p>You can use elements from other page templates located in the <strong>wp-content\/themes\/CherryFramework <\/strong>folder to create\u00a0 a unique page. <\/p>\r\n<\/li>\r\n<li>\r\n<p>Let&rsquo;s first add a header and footer  to it:<\/p>\r\n<pre class=\"brush:php\">\r\n&lt;?php\r\n  \/**\r\n  * Template Name: Custom\r\n  *\/\r\nget_header(); ?&gt;\r\n&lt;?php get_footer(); ?&gt;\r\n\r\n<\/pre>\r\n<\/li>\r\n<li>\r\n<p>If you save the changes, you can see  them on your page:<\/p>\r\n<p><a href=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/0204\/03\/wordpress_cherry_new_page_template_adding_2.jpg\"><img loading=\"lazy\" src=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/0204\/03\/wordpress_cherry_new_page_template_adding_2-300x137.jpg\" alt=\"wordpress_cherry_new_page_template_adding_2\" width=\"300\" height=\"137\" class=\"aligncenter size-medium wp-image-33941\" \/><\/a><\/p>\r\n<\/li>\r\n<li>\r\n<p>Now you need to decide what kind of  content you&rsquo;d like to see on that page. Let&rsquo;s say\u00a0 you\u00a0  have no separate page template for the &ldquo;Our Team&rdquo; custom posts. And you  really like the layout of the Testimonials page template and would like to see  the &ldquo;team&rdquo; custom posts with the same layout. Under the <strong> Appearance -&gt;  Editor<\/strong> menu, you can easily determine the name of the\u00a0file used for the Testimonials page template. It is\u00a0<strong>page-testi.php<\/strong>.<\/p>\r\n<p><a href=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/0204\/03\/wordpress_cherry_new_page_template_adding_3.jpg\"><img loading=\"lazy\" src=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/0204\/03\/wordpress_cherry_new_page_template_adding_3-138x3001.jpg\" alt=\"wordpress_cherry_new_page_template_adding_3\" width=\"138\" height=\"300\" class=\"aligncenter size-medium wp-image-33942\" \/><\/a><\/p>\r\n<\/li>\r\n<li>\r\n<p>Open this\u00a0file to edit. Copy only the content part since  we already have the header and footer (this is just an example, so your code  may be different):<\/p>\r\n<pre class=\"brush:php\">\r\n&lt;div class=&quot;motopress-wrapper content-holder clearfix&quot;&gt;\r\n  &lt;div class=&quot;container&quot;&gt;\r\n  &lt;div class=&quot;row&quot;&gt;\r\n  &lt;div class=&quot;&lt;?php echo cherry_get_layout_class( 'full_width_content' ); ?&gt;&quot; data-motopress-wrapper-file=&quot;page-testi.php&quot; data-motopress-wrapper-type=&quot;content&quot;&gt;\r\n  &lt;div class=&quot;row&quot;&gt;\r\n  &lt;div class=&quot;&lt;?php echo cherry_get_layout_class( 'full_width_content' ); ?&gt;&quot; data-motopress-type=&quot;static&quot; data-motopress-static-file=&quot;static\/static-title.php&quot;&gt;\r\n  &lt;?php get_template_part(&quot;static\/static-title&quot;); ?&gt;\r\n  &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n  &lt;div class=&quot;row&quot;&gt;\r\n  &lt;div class=&quot;&lt;?php echo cherry_get_layout_class( 'content' ); ?&gt; &lt;?php echo of_get_option('blog_sidebar_pos'); ?&gt;&quot; id=&quot;content&quot; data-motopress-type=&quot;loop&quot; data-motopress-loop-file=&quot;loop\/loop-testi.php&quot;&gt;\r\n  &lt;?php get_template_part(&quot;loop\/loop-testi&quot;); ?&gt;\r\n  &lt;\/div&gt;\r\n  &lt;div class=&quot;&lt;?php echo cherry_get_layout_class( 'sidebar' ); ?&gt; sidebar&quot; id=&quot;sidebar&quot; data-motopress-type=&quot;static-sidebar&quot; data-motopress-sidebar-file=&quot;sidebar.php&quot;&gt;\r\n  &lt;?php get_sidebar(); ?&gt;\r\n  &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n<\/pre>\r\n<\/li>\r\n<li>\r\n<p>Add the content to\u00a0the new.php file. Rename: <strong><em>Template  Name: Custom<\/em><\/strong> to <em><strong>Template  Name: Team<\/strong><\/em><\/p>\r\n<\/li>\r\n<li>\r\n<p>Change <strong><em>page-testi.php<\/em><\/strong> to <strong><em>new.php<\/em><\/strong> in the code.<\/p>\r\n<\/li>\r\n<li>\r\n<p>The code also contains the reference to the loop\/loop-testi.php file.  This is another file you need to copy. Copy <strong>loop-testi.php<\/strong> from <strong>wp-content\/themes\/CherryFramework\/loop. <\/strong>And  paste it to the <strong>wp-content\/themes\/theme#####\/loop <\/strong>folder (if there is no <strong>loop <\/strong>\u00a0folder there, you will need to create it).  Rename the file to e.g. <strong><em>loop-new.php<\/em><\/strong> and open it for editing. Change the word &ldquo;testi<strong>&rdquo; <\/strong>everywhere in this file to &ldquo;team&rdquo; and  save the changes. (You can do this using Control (Command) + F).<\/p>\r\n<p><a href=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/0204\/03\/wordpress_cherry_new_page_template_adding_4.jpg\"><img loading=\"lazy\" src=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/0204\/03\/wordpress_cherry_new_page_template_adding_4-300x1371.jpg\" alt=\"wordpress_cherry_new_page_template_adding_4\" width=\"300\" height=\"137\" class=\"aligncenter size-medium wp-image-33943\" \/><\/a><\/p>\r\n<\/li>\r\n<li>\r\n<p>Since the loop-new.php is created  and modified, you can go back to the <strong>new.php <\/strong>file and change <strong>loop\/loop-testi.php<\/strong>  to <strong>loop\/loop-new.php<\/strong> in the code. The finished code will look like this:<\/p>\r\n<pre class=\"brush:php\">\r\n&lt;?php\r\n  \/**\r\n  * Template Name: Team\r\n  *\/\r\nget_header(); ?&gt;\r\n&lt;div class=&quot;motopress-wrapper content-holder clearfix&quot;&gt;\r\n  &lt;div class=&quot;container&quot;&gt;\r\n  &lt;div class=&quot;row&quot;&gt;\r\n  &lt;div class=&quot;&lt;?php echo cherry_get_layout_class( 'full_width_content' ); ?&gt;&quot; data-motopress-wrapper-file=&quot;new.php&quot; data-motopress-wrapper-type=&quot;content&quot;&gt;\r\n  &lt;div class=&quot;row&quot;&gt;\r\n  &lt;div class=&quot;&lt;?php echo cherry_get_layout_class( 'full_width_content' ); ?&gt;&quot; data-motopress-type=&quot;static&quot; data-motopress-static-file=&quot;static\/static-title.php&quot;&gt;\r\n  &lt;?php get_template_part(&quot;static\/static-title&quot;); ?&gt;\r\n  &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n  &lt;div class=&quot;row&quot;&gt;\r\n  &lt;div class=&quot;&lt;?php echo cherry_get_layout_class( 'content' ); ?&gt; &lt;?php echo of_get_option('blog_sidebar_pos'); ?&gt;&quot; id=&quot;content&quot; data-motopress-type=&quot;loop&quot; data-motopress-loop-file=&quot;loop\/loop-new.php&quot;&gt;\r\n  &lt;?php get_template_part(&quot;loop\/loop-new&quot;); ?&gt;\r\n  &lt;\/div&gt;\r\n  &lt;div class=&quot;&lt;?php echo cherry_get_layout_class( 'sidebar' ); ?&gt; sidebar&quot; id=&quot;sidebar&quot; data-motopress-type=&quot;static-sidebar&quot; data-motopress-sidebar-file=&quot;sidebar.php&quot;&gt;\r\n  &lt;?php get_sidebar(); ?&gt;\r\n  &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n&lt;?php get_footer(); ?&gt;\r\n\r\n<\/pre>\r\n<\/li>\r\n<li>\r\n<p>Save the changes and check your new  page. It should have the team custom posts on the testimonials layout page.<\/p>\r\n<p><a href=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/0204\/03\/wordpress_cherry_new_page_template_adding_5.jpg\"><img loading=\"lazy\" src=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/0204\/03\/wordpress_cherry_new_page_template_adding_5-300x1451.jpg\" alt=\"wordpress_cherry_new_page_template_adding_5\" width=\"300\" height=\"145\" class=\"aligncenter size-medium wp-image-33944\" \/><\/a><\/p>\r\n<\/li>\r\n<\/ol>\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n<p><a href=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/0204\/03\/watch?v=02VnBHwd3ZY?width=1280&amp;height=720\" rel=\"prettyPhoto\">WordPress. How to create page templates<\/a><\/p>\r\n<\/p>\r\n<p>In case you&#8217;re seeking premium themes to put up a professional website, take a look at <a href=\"https:\/\/www.templatemonster.com\/category\/design-photography-wordpress-themes\/\">design wordpress templates<\/a>. Or check out a wide variety of <a href=\"https:\/\/www.templatemonster.com\/wordpress-themes.php\">WordPress templates page<\/a> for even more beautiful designs.<\/p> \r\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial is going to show you how to add new page templates to your WordPress Cherry Framework template.<\/p>\n","protected":false},"author":30,"featured_media":33948,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[247,728],"tags":[1419,796,572,767,2405],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/7783"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=7783"}],"version-history":[{"count":5,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/7783\/revisions"}],"predecessor-version":[{"id":83673,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/7783\/revisions\/83673"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/33948"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=7783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=7783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=7783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}