{"id":17376,"date":"2020-05-21T12:14:43","date_gmt":"2020-05-21T12:14:43","guid":{"rendered":"https:\/\/ampforwp.com\/tutorials\/?post_type=ht_kb&#038;p=17376"},"modified":"2020-05-21T12:31:36","modified_gmt":"2020-05-21T12:31:36","slug":"how-to-override-archive-template-in-amp","status":"publish","type":"ht_kb","link":"https:\/\/ampforwp.com\/tutorials\/article\/how-to-override-archive-template-in-amp\/","title":{"rendered":"How to override Archive Template in AMP"},"content":{"rendered":"\n<p>The following are the steps to override Archive\u00a0Template 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>Archive: archive.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  archive.php add your page.php in this folder and it will override the  archive.php\u00a0of your AMP and if you want to override only the specific archive then you need to add post name of that archive file like \u2013<\/p>\n\n\n\n<p> <code>archive-{$post_type}.php<\/code><br>Post type archive<br><code>archive-{$post_type}.php<\/code> <\/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 Archive\u00a0Template 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 like&#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\/17376"}],"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=17376"}],"version-history":[{"count":2,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/17376\/revisions"}],"predecessor-version":[{"id":17405,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/17376\/revisions\/17405"}],"wp:attachment":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/media?parent=17376"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-category?post=17376"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-tag?post=17376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}