I'm using WordPress theme Twenty Ninteen and trying to make a travel blog with the help of travel affiliate API get from Travelpayouts.
<script charset="utf-8" src="//www.travelpayouts/widgets/920a6b8c6fc20070013d2e04f690210d.js?v=1649" async></script>
This is form code to display on pages/post, if I use on any post on page code working fine but I need to add this code in the header to display like.
I try to use the plugin for header & footer to paste the code & display but via plugin code working in the footer but in header nothing display.
I'm using WordPress theme Twenty Ninteen and trying to make a travel blog with the help of travel affiliate API get from Travelpayouts.
<script charset="utf-8" src="//www.travelpayouts/widgets/920a6b8c6fc20070013d2e04f690210d.js?v=1649" async></script>
This is form code to display on pages/post, if I use on any post on page code working fine but I need to add this code in the header to display like.
I try to use the plugin for header & footer to paste the code & display but via plugin code working in the footer but in header nothing display.
Share Improve this question asked Apr 3, 2019 at 7:50 FormaLFormaL 1035 bronze badges1 Answer
Reset to default 0You need to edit header.php
of your theme and insert the script there right after the site navigation.
I try to use the plugin for header & footer to paste the code & display but via plugin code working in the footer but in header nothing display.
Plugins fail to insert this in header because these plugins use wp-header
hook which output in <head>
tag and not in the <body>
tag, so the output is not visible.
While those plugins which uses wp_footer
hook outputs everything within <body>
tag, so the output is visible.