• Home
  • New Entries
  • Popular Entries
  • Submit a Story
  • About

Add Google Search to Your WordPress Blog ...

The native WordPress search does not return very relevant results, thus it makes a lot of sense to add Google Search into your WordPress Blog. In addition, Google Search can be easily integrated with Google AdSense.

There are a variety of plugins that allow you to integrate Google Search into your WordPress Blog. I have chosen to use the ‘Search API’ Plugin that was developed by Justin Shreve and Andy Skelton at WordPress.

This blog, as well as my ShibaShake website are both using the Search API/Google plugin, so feel free to test it out by doing a search on this page or on the ShibaShake homepage.

The Search API Plugin is a WordPress developed plugin, and much of the API code will likely be included in future versions of the WordPress Core. WordPress developed plugins tend to be well supported and often get updated across new WordPress releases.

However, you may need to make some changes to the Search API Plugin so that it integrates properly with your current WordPress theme and environment. Here are some things to look out for -


1. The ‘Search API Plugin’ installs 3 different plugins.

To use Google Search make sure that the Search API Plugin and the Google Search Plugin are both activated.

If you get a ‘You do not have sufficient permission to access this page’ error message while trying to Edit Search Settings, then chances are the Search API Plugin has not been activated.


2. Search results may not display properly.

If your theme is set to display post excerpts, it may not properly show the search results. This is because the Google Search Plugin keeps the search results within the post_content attribute of a temporary post object.

To fix this, you may need to make some changes to your theme index.php file so that it uses the_content to show the search results instead of the_excerpt.

The Shiba Theme has been updated to properly show search results for the Google Search Plugin as of release 2.3.


3. Search results may not fill the page.

Depending on your theme, the search results may sometimes not fill the entire width of the page.

To fix this -

   1. Go into Plugins and Edit the Google Search Plugin.
   2. Select the search/google.php file on the right.
   3. Search for -

      <style type="text/css" media="all">
       #srchResult iframe {
            width: inherit;
       }
      </style>

      Change width to the number of pixels that you want or to a percentage. 100% will use the entire space available. For example -

      <style type="text/css" media="all">
       #srchResult iframe {
            width: 100%;
       }
      </style>

4. Change Google AdSense advertisement location.

   1. Edit the Google Search Plugin.
   2. Select the search/google.php file on the right.
   3. Search for -

      $_GET[cof] =  "FORID:10";

   4. Replace the “FORID:10″ text with your chosen Google AdSense advertisement option.
          * FORID:10 sets the Google AdSense advertisements to appear on the Top and Right.
          * FORID:9 sets the Google AdSense advertisements to appear on the Right.
          * FORID:11 sets the Google AdSense advertisements to appear on the Top and Bottom.

5. Search may no longer work in your WordPress dashboard.

The Google Search Plugin replaces all WordPress command line searches with a Google Search so your regular WordPress dashboard post, page, and media searches may no longer work.

To fix this,

   1. Edit the Google Search Plugin.
   2. Select the search/google.php file on the right.
   3. Search for -

       function google_search()

   4. Add the line below to the beginning of the function -

      if (is_admin()) return;

      The result should look like this -

       function google_search() {
                 if (is_admin()) return;
      ...

 Original Source:
http://www.shibashake.com/wordpress-theme/add-google-search-to-your-wordpress-blog

AddThis Social Bookmark Button

Posted at 01:47:09 pm | Permalink | Posted in How to Blog  

Related Stuff

Google Buzz Button Wordpress Plugin Released

If you are looking for a Google Buzz button to add into your Wordpress site then we have released the first Wordpress plugin exclusively ...

Plug And Play Ecommerce With Wordpress Plugins

Since 2003 Wordpress has slowly been gaining popularity amongst the elite of the internet, the bloggers. It is one of those few things ...

Add More Sidebars to Your WordPress Theme

You can add more than one sidebar section to your WordPress site. For example, with the stc-intermountain.org site, I added a whole bunch ...

Series Posting in Wordpress

In my functions.php file, I have some code which implements series posting. This relies on the thematic ...

10 Alternative Uses for WordPress

WordPress is the best and most popular blogging platform around. It’s free, easy to use, endlessly customizable and supported by ...

Top Stuff

Free Blogger templates Anime Themes

Wordpress Guestbook Generator Plugin

48 Unique Ways To Use WordPress

WordPress Single Post Templates

GeekLog

Get The Image WordPress Plugin



About Webloglines

Webloglines is a project offers a comprehensive collection of blogging services, articles, themes and plugins from around the world. Whether you're looking to promote your own blog or find blogs on various topics, this site is for you.


Search


Topics

  • Adsense (12)
  • Blogging Tips (73)
  • Blogs Slides (25)
  • Blogs Websites (22)
  • Digg (20)
  • How to Blog (129)
  • Search Engines (9)
  • SEO (135)
  • WordPress Plugins (269)
  • WordPress Security (75)
  • Wordpress Themes (99)
  • Wordpress Tips (162)

© 2006 www.webloglines.com. All Rights Reserved. Powered by IRange