{"id":17390,"date":"2020-05-21T07:36:29","date_gmt":"2020-05-21T07:36:29","guid":{"rendered":"https:\/\/ampforwp.com\/tutorials\/?post_type=ht_kb&#038;p=17390"},"modified":"2020-05-21T11:46:20","modified_gmt":"2020-05-21T11:46:20","slug":"how-to-override-page-template-in-amp","status":"publish","type":"ht_kb","link":"https:\/\/ampforwp.com\/tutorials\/article\/how-to-override-page-template-in-amp\/","title":{"rendered":"How to override Page Template in AMP"},"content":{"rendered":"\n<p> The following are the steps to override  Page Template in AMP <\/p>\n\n\n\n<p><strong>Step 1:<\/strong><\/p>\n\n\n\n<p>Create a folder named \u201c<strong>ampforwp<\/strong>\u201d in your theme which you are currently using.<\/p>\n\n\n\n<p>e.g: if you are using twenty seventeen theme then you have to create ampforwp&nbsp;folder in the twenty seventeen theme folder<\/p>\n\n\n\n<p>The directory will look like<\/p>\n\n\n\n<p>ex:wp-content\/themes\/twenty seventeen\/ampforwp<\/p>\n\n\n\n<p>  Page: page.php <\/p>\n\n\n\n<p><strong>Step 2:<\/strong><\/p>\n\n\n\n<p>Add the file which you want to override in this folder.<\/p>\n\n\n\n<p>For example: If you want to override all pages then you have to create page.php add your page.php in this folder and it will override the page.php&nbsp;of your AMP and if you want to override only the specific page then you need to add post name or ID of that page file like &#8211; <\/p>\n\n\n\n<p> <code>page-{$id}.php<\/code> <br> <code>page-{$pagename_decoded}.php<\/code><br><code>page-{$pagename}.php<\/code><br><\/p>\n\n\n\n<p><strong>That\u2019s it for this tutorial!<\/strong><\/p>\n\n\n\n<p>We hope it helped you. If you have any feedback or questions, then please share them in the comments section below.<\/p>\n<div id=\"div-1\" class=\"hkb-feedback\">\n\t\t\t<strong class=\"ht-mobile-exit__title\">Ask your Questions Directly!<\/strong><br>\n\t\t\t<div class=\"hkb_widget_exit__content\" style=\"font-size: 14px;\">If you can't find the solutions in this article, then just ask us in the comments and we will answer it for you!<\/div>\n\t\t\t<a href=\"https:\/\/ampforwp.com\/support\/#contact\" id=\"button\" target=\"_blank\" rel=\"noopener noreferrer\"><button>Yes, I have a Question<\/button><\/a>\n\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>The following are the steps to override Page Template in AMP Step 1: Create a folder named \u201campforwp\u201d in your theme which you are currently using. e.g: if you are using twenty seventeen theme then you have to create ampforwp&nbsp;folder in the twenty seventeen theme folder The directory will look&#8230;<\/p>\n","protected":false},"author":18,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":[],"ht-kb-category":[186],"ht-kb-tag":[],"_links":{"self":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/17390"}],"collection":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/comments?post=17390"}],"version-history":[{"count":7,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/17390\/revisions"}],"predecessor-version":[{"id":17399,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/17390\/revisions\/17399"}],"wp:attachment":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/media?parent=17390"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-category?post=17390"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-tag?post=17390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}