最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Embed Form In Header

programmeradmin2浏览0评论

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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

You 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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论