Archived topic
header Scritp
3 replies · Started by Paolo Fauci on September 21, 2019
Hello
I'm using 2 plugins
1 Histast
2 "SOGO Add Script Header Footer" for a Script verifying emails
I would like to know if with the generatepress element I can insert scripts for all pages and for individual pages.
That way I can delete 2 plugins.
The email verification script must be entered just before the </body> tag of your website.
While that of Histast I can insert it wherever I prefer in the footer
My question is: how do I create these Script Elements with GeneratePress?
This is something I've never done.
Can you help me?
Thanks
Paolo
Hi there,
yes you can use the Hook Element for this, which has Display Rules so can be applied to the Entire site or specific posts, pages, archives etc.
All scripts need to be wrapped in:
<script>
// Your script goes here
</script>
Adding Scripts to the <head> - select the WP_header hook
in the <footer> or just before the </body> - select the WP_footer hook
Just after the opening <body> select Custom Hook and add wp_body_open
The last one will be added to the list of hooks in GPP 1.9
Hi David, thank you very much
When I create element and put the code I leave it so because they are already present
<Script>
</Script>
I don't have to enter this code in yours. Right?
<!-- Histats.com START (aync)-->
<script type="text/javascript">var _Hasync= _Hasync|| [];
_Hasync.push(['Histats.start', '1,4067639,4,0,0,0,00010000']);
_Hasync.push(['Histats.fasi', '1']);
_Hasync.push(['Histats.track_hits', '']);
(function() {
var hs = document.createElement('script'); hs.type = 'text/javascript'; hs.async = true;
hs.src = ('//s10.histats.com/js15_as.js');
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(hs);
})();</script>
<noscript><a href="/" target="_blank"><img src="//sstatic1.histats.com/0.gif?4067639&101" alt="contatore statistiche per siti" border="0"></a></noscript>
<!-- Histats.com END -->
If possible I would like to ask another thing about "elements"
In the wordpress articles there are the categories
How can I generate pages from these categories?
How do I customize these pages with GeneratePress and Elementor?
Let me know if I need to open another ticket for this question
Thanks
Thats correct - no need to add that code inside the <script><script> tags as they are already in the code.
New topic would be best