Google CSE corrupt in search page

Posted in: Newsmag
Post count: 199

Hi,

I tried to enter the Google custom search code but I so -> https://dl.dropboxusercontent.com/u/22334399/Schermata%202015-04-18%20alle%2015.43.14.png

Because you see so bad?

This is the Google code ->

<script>
(function() {
var cx = ‘002479567620345562056:7vhuqy7cxts’;
var gcse = document.createElement(‘script’);
gcse.type = ‘text/javascript’;
gcse.async = true;
gcse.src = (document.location.protocol == ‘https:’ ? ‘https:’ : ‘http:’) +
‘//www.google.com/cse/cse.js?cx=’ + cx;
var s = document.getElementsByTagName(‘script’)[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>

Post count: 7909

Hi,

I have checked your site and did not found custom search. Please provide more details were did you added the code and provide a link when it is enabled.
Also if you want to replace theme default search with google you can follow this topic: https://forum.tagdiv.com/topic/replace-default-search-with-google/

Thanks!

Post count: 199

I tried to paste the code found below in the file page-search-box.php. We would like to replace the Google box instead of your search, keeping the results below.

<script>
(function() {
var cx = ‘002479567620345562056:7vhuqy7cxts’;
var gcse = document.createElement(‘script’);
gcse.type = ‘text/javascript’;
gcse.async = true;
gcse.src = (document.location.protocol == ‘https:’ ? ‘https:’ : ‘http:’) +
‘//www.google.com/cse/cse.js?cx=’ + cx;
var s = document.getElementsByTagName(‘script’)[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>

Post count: 6600

Hi,

I’ve tested your google search script and had the same result but I had this js error as some resources from google failed to load: http://screencast.com/t/pOqHEX9bbq

This might be because its your code for google search. I believe you also have this error so make sure you use the right code custom google search script and go this help guide for more info: https://support.google.com/customsearch/?hl=en#topic=4513742

Thanks for the message!

Post count: 101

Hello friends. I have created a tutorial to integrate Google Custom Search Engine to Newspaper theme. Check it here – http://www.getcooltricks.com/wordpress/google-cse-integration-to-newspaper-wordpress-theme/ .

It works perfect. Check my site for demo.

You can suggest, if any modifications are needed in that.

Post count: 9544

@Pradeep Augustine

awesome sauce!!!

Post count: 101

Thank you @Chris S, there was an error in the code which i had provided in my tutorial. I had corrected it and it works perfect now.

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