{"id":431,"date":"2017-07-04T11:57:43","date_gmt":"2017-07-04T11:57:43","guid":{"rendered":"https:\/\/ampforwp.com\/tutorials\/?p=431"},"modified":"2017-07-26T03:54:47","modified_gmt":"2017-07-26T03:54:47","slug":"add-view-non-amp-things-header","status":"publish","type":"ht_kb","link":"https:\/\/ampforwp.com\/tutorials\/article\/add-view-non-amp-things-header\/","title":{"rendered":"How to add View non AMP and other things in Header"},"content":{"rendered":"<p>I am making this tutorial to show how to add View non-AMP and other things in Header.<\/p>\n<p>So, let&#8217;s dig into it.<\/p>\n<p>First, create a Custom plugin, you can just copy this code as well.<br \/>\n<script src=\"https:\/\/gist.github.com\/MARQAS\/505e1f3bf59c34e7c6b3eb5a47195c37.js\"><\/script><\/p>\n<amp-gist data-gistid=505e1f3bf59c34e7c6b3eb5a47195c37 \r\n  \t\tlayout=\"fixed-height\"\r\n  \t\theight=\"200\">\r\n  \t\t<\/amp-gist>\n<p>After creating a custom plugin, add the code in the header using the hook.<\/p>\n<p>You can copy this code as well(only if you are using Design 2)<\/p>\n<pre class=\"lang:default decode:true \">add_action('ampforwp_header_top_design2','view_non_amp_header');\r\n\r\nfunction view_non_amp_header(){\r\n\tampforwp_view_nonamp();\r\n }<\/pre>\n<p><strong>Note:\u00a0<\/strong>Don&#8217;t forget to change the hook name if you are using a different design. You can check the hooks name here: <a href=\"https:\/\/github.com\/ahmedkaludi\/accelerated-mobile-pages\/commit\/2498820121ea4bd0c027d744e8862797a0519b17\">Hooks in Header<\/a><\/p>\n<p>You can add other things like text, images etc., as well.<\/p>\n<p>Isn&#8217;t it easy? you can do it while having your morning coffee as well.<\/p>\n<p>If you have any queries regarding this feel free to ask.<\/p>\n<p>And don&#8217;t forget to leave the feedback if it helps you. \ud83d\ude42<\/p>\n<p><a href=\"https:\/\/wordpress.org\/support\/plugin\/accelerated-mobile-pages\/reviews\/\">https:\/\/wordpress.org\/support\/plugin\/accelerated-mobile-pages\/reviews\/<\/a><\/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>I am making this tutorial to show how to add View non-AMP and other things in Header. So, let&#8217;s dig into it. First, create a Custom plugin, you can just copy this code as well. After creating a custom plugin, add the code in the header using the hook. You&#8230;<\/p>\n","protected":false},"author":5,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":[],"ht-kb-category":[34],"ht-kb-tag":[],"_links":{"self":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/431"}],"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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/comments?post=431"}],"version-history":[{"count":3,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/431\/revisions"}],"predecessor-version":[{"id":434,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/431\/revisions\/434"}],"wp:attachment":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/media?parent=431"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-category?post=431"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-tag?post=431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}