Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.3k views
in Themes by
closed by

hi

i dont want to use q2a google search plugin

i try to add google script code to my qa-theme.php

function search_widget()
{
$this->output(
'<aside id="search-4" class="widget widget_search">',
'<p class="widget-title">جستجو در سوالات</p>',


<script>
  (function() {
    var cx = '011900192141920744246:n9jj1rxodww';
    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>


'</aside>'
);

but when i open my q2a site , i just see white page

i try to add / before ' to fix error

but still not working

can you help me about output of this script ???

thanks

Q2A version: 1.7
closed with the note: problem solved

1 Answer

0 votes
by
selected by
 
Best answer

problem solved by using

EOF



before output code 

...