I’m using the Google Custom Search plugin by edwinkwan (the first that appears in the wordpress plugin repository).
I added the search box:
<?php display_search_box(DISPLAY_RESULTS_CUSTOM); ?>
in the header.
and the results:
<?php display_gsc_results(); ?>
in this page:
http://alexchen.info/taiwantalk/search-results
(Which is a tempalte called search-results.php
)
Now, I can only see the results if I perform a search in that page (with the search box in the header). If I just search for something, for example, in the front page, absolutely nothing happens.
For instance, If I perform search from: alexchen.info/taiwantalk
Nothing happens.
I couldn’t find anything like: “the search results page” in my Google Custom Search Panel.
Apparently the Custom Google Search is working but the search is not being redirected to search-results.php
when I perform a search in any other page.
Any suggestions to fix this?
EDIT:
I also tried this plugin: wordpress.org/extend/plugins/google-custom-search-for-wordpress/ but it seem to be based on the code of Google Custom Search of 2010. It requires you to get two pieces of code (the search box and the search results). But Google Custom Search’s Panel only provides one.
Like this:
<div id="cse" style="width: 100%;">Loading</div>
<script src="https://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1', {language : 'en'});
google.setOnLoadCallback(function() {
var customSearchControl = new google.search.CustomSearchControl('018208799159621054256:jivnd4spmig');
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
customSearchControl.draw('cse');
}, true);
</script>
<link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" />