How to add JavaScript in header?

Posted in: Newspaper
Post count: 364

I want to add in Header section Javascript code to demonstrate Sirve 360 product

<script src="https://scripts.sirv.com/sirv.js"></script>

javascript code
I want to add it with help pf custom code – but this section wants another Javascript format – URL is not allowed:
custom code
Questions:
1. Is it possible to add all code of https://scripts.sirv.com/sirv.js into this section ?
2. I want to load JS script only for selected pages. Is it possible to control this include method by page\post URL or ID?

Post count: 623

Hello @kibiribi

1. Goto theme panel >> Analytics/JS Codes >> Paste <script src="https://scripts.sirv.com/sirv.js"></script> in Header script code section. This will add script for all pages and posts on the site.

Refer: https://prnt.sc/se5nxq

2. To add it on selected pages you can consider adding it by custom functions to theme’s functions.php file or plugin like SOGO Add Script to Individual Pages Header Footer

Hope you will find this helpful.

Post count: 364

Thanks for the explanation, Amit!
One more question: is it possible to add JS file link https://scripts.sirv.com/sirv.js inside of JS code?

  • This reply was modified 6 years by kibiribi.
Post count: 18283

Hello !

Please note that your request is custom work based and it is not covered by the support team: https://forum.tagdiv.com/newspaper-theme-support/

Thank you !

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.