Are you trying to integrate Google analytics on your site?
no, do you know google search engine toolbar?
The code that is appearing on your About page? It’s apparently missing the tags needed for it to be treated as code and not content. It could be you didn’t quite copy the entire code, or your WP user does not have unfiltered HTML capability, which causes such tags to be stripped out.
Page content may not be the best place for that kind of code. It may be better on a template file somewhere. There’s a number of variables to consider for how and where it’s placed.
Is the toolbar supposed to appear only on one page or all pages? Where does Google suggest it be placed?
JavaScript code shouldn’t be added with the page editor, it should be added to the theme’s code or to a separate plugin’s code. If you don’t know how to do that, you could use a plugin like Header and Footer Scripts to add the code to the footer of the entire website or of an individual page.
it should be added to the theme’s code or to a separate plugin’s code
HI there,
so I’m in edit header/ footer script, where do I insert this code from google search?
Thanks for your help
Alex
Hi,
It’s best to put the code in the footer, you could edit the footer.php file of the theme and put the code there. If you don’t want to mess with editing the theme directly, you could use the Header and Footer Scripts plugin https://wordpress.org/plugins/header-and-footer-scripts/ to add the code.
HI Ciprian,
I’ve copied at the footer of header/footer srcipt.
I’ve got this error
“Parse error: syntax error, unexpected ‘var’ (T_VAR) in /home2/alexledu/public_html/wp-content/plugins/header-and-footer-scripts/shfs.php on line 364”
the code :
<script>
(function() {
var cx = ‘016421109276741999796:i3yjskygpmc’;
var gcse = document.createElement(‘script’);
gcse.type = ‘text/javascript’;
gcse.async = true;
gcse.src = ‘https://cse.google.com/cse.js?cx=’ + cx;
var s = document.getElementsByTagName(‘script’)[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>
do you know why there is Fatal error ?
Thanks
Alex
thanks for the WP google search, it seems a bit easier to use but I’m in edit plugin, where do I insert the search engine ID ?
THANKS
Alex
I’ve inserted my engine ID, but the search fails to provide any result besides “not found”
Thanks
Alex