I have used google custom search engine and used their code provided in my website.
I have this issue in the (search.php) that I cant place the < ?php endif; ?> and I get an error ( Parse error: syntax error, unexpected 'endif' (T_ENDIF) )
How can I add that endif on the search.php file ?
this is part where I use the google code:
<?php $j=0; $i =0; if (have_posts()) : while (have_posts()) : the_post(); ?>
<script>
(function() {
var cx = '000306723311332550300:g5hpmnp8s68';
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>