{"id":9818,"date":"2019-05-14T10:14:44","date_gmt":"2019-05-14T10:14:44","guid":{"rendered":"https:\/\/ampforwp.com\/tutorials\/?post_type=ht_kb&#038;p=9818"},"modified":"2020-04-27T07:47:52","modified_gmt":"2020-04-27T07:47:52","slug":"how-to-override-a-template-file-in-amp","status":"publish","type":"ht_kb","link":"https:\/\/ampforwp.com\/tutorials\/article\/how-to-override-a-template-file-in-amp\/","title":{"rendered":"How to override a template file in AMP"},"content":{"rendered":"\n<p>The following are the steps to override a template file in AMP<\/p>\n\n\n\n<p><strong>Step 1:<\/strong><\/p>\n\n\n\n<p>Create a folder with the name \u201campforwp\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 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\/twentyseventeen\/ampforwp<\/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 single.php add your single.php in this folder and it will override the single.php&nbsp;of your AMP. ( Suppose you have Design-2 then this file will override the single.php of Design-2).<\/p>\n\n\n\n<p>Similarly, you can override any file you want.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h4 id=\"to-make-it-easy-we-have-created-a-video-tutorial-on-amp-story-that-you-can-watch-below\">To make it easy, we have created a video also<\/h4>\n\n\n\n<figure class=\"wp-block-video\">\r\n<div style=\"width: 643px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-9818-1\" width=\"643\" height=\"321\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/05\/Recording-25.mp4?_=1\" \/><a href=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/05\/Recording-25.mp4\">https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/05\/Recording-25.mp4<\/a><\/video><\/div>\r\n<\/figure>\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\n\n\n<p>&nbsp;<\/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 a template file in AMP Step 1: Create a folder with the name \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 folder in the twenty seventeen theme folder&#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\/9818"}],"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=9818"}],"version-history":[{"count":11,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/9818\/revisions"}],"predecessor-version":[{"id":17198,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/9818\/revisions\/17198"}],"wp:attachment":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/media?parent=9818"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-category?post=9818"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-tag?post=9818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}