niammuddin

Google CSE Search Wordpress

Jun 29th, 2014
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.74 KB | None | 0 0
  1.  
  2. <!-- START GOOGLE CSE -->
  3. <div class="post">
  4. <div id="hasilpencarian">
  5.  <script src="http://www.google.com/jsapi"></script>
  6.     <script type="text/javascript">
  7.       google.load('search', '1');
  8.       function OnLoad() {
  9.       // Create a custom search control that uses a CSE restricted to code.google.com
  10.       var customSearchControl = new google.search.CustomSearchControl('partner-pub-0540024532645583:3637158735');
  11.       // Draw the control in content div
  12.       customSearchControl.draw('hasilpencarian');
  13.       // run a query
  14.       customSearchControl.execute('<?php echo "$s" ?>');
  15.     }
  16.     google.setOnLoadCallback(OnLoad);
  17.     </script>
  18. <div id="hasilpencarian">Loading...</div>
  19. </div>
  20. <style>
  21. #hasilpencarian .gsc-cursor-page{width:15px;float:left;cursor:pointer}
  22. #hasilpencarian .gsc-webResult{margin:10px 0}
  23. #hasilpencarian .gs-result .gs-title{color:#069;font:normal normal 18px Cambria;padding:0;}
  24. #hasilpencarian .gsc-input{width:430px;margin-right:2px;}
  25. #hasilpencarian table.gsc-resultsHeader{width:100%}
  26. #hasilpencarian form.gsc-search-box{text-align:center;margin:20px 0 10px}
  27. #hasilpencarian .gsc-twiddle{width:25px;float:left}
  28. #hasilpencarian .gs-watermark a{color:#afafaf}
  29. #hasilpencarian .gs-visibleUrl-long{display:none}
  30. #hasilpencarian .gsc-control-cse{font-size:12px}
  31. #hasilpencarian{width:100%;padding:0 0 4px}
  32. .gs-snippet{border-top:1px solid #82caef;}
  33. form .gsc-search-box{-moz-border-radius:5px;border-radius:5px;border:1px solid #82caef;padding:0 10px;background:#f3f3f3;margin:5px 0;}
  34. .gsc-table-cell-thumbnail,.hidden,hr,#hasilpencarian .gs-visibleUrl-short,#hasilpencarian .gsc-twiddle,#hasilpencarian .gsc-stats,#hasilpencarian .gsc-results-selector{display:none}
  35. </style>
  36. </div>
  37. <!--// END GOOGLE CSE -->
Add Comment
Please, Sign In to add comment