hontou ni
15May/097

Embracing Google Search's tentacles

Broken search (my fault) was one of the reasons why the theme was switched from K2 to Vigilance. While things worked better in the new theme, one of my dissatisfactions with the native WP search was how it returned the same number of search results as the maximum number of posts on the main page (add: also search results were returned in reverse chronological order rather than relevance). The 'Search Posts' function was (somehow) rather better but, as it was located in the backend, it wasn't going to be of much help to readers.

And thus I was much enthused by Kabitzin's post on how to incorporate The Borg Google Search into your blog. Where the Sea Slugs! Triumvirate leads, the Holy Hontounia Empire follows. At least in terms of WordPress stuff. And, thus, I'm feeling the tentacle monster love.

Kabitzin's step by step guide was easy to follow but still not completely idiot proof. I still managed to screw things up when I AM LAZY. After (1) getting the code from Google AdSense For Search, I just pasted the Google incantation from the second box into a page based on the normal template and got the above mess. orz

I beat a hasty retreat and (2) created a custom search page based on the page.php, removed the sidebar, pasted in the Google code and installing the Exclude Pages plugin. Since Vigilance already had a search.php file, I decided to name the custom page something else instead and put it into the child theme folder. Whereupon the NAME_OF_CUSTOM_TEMPLATE (i.e. Google AdSense Search) appeared and the page was duly created.

(3) Replacing the Search Widget was also easy. Under the left column's Appearance > Widgets was the Text widget (Arbitrary text or HTML) and in went the code from the first box. As I've mentioned, I AM LAZY so I haven't bothered to (4) Tweak My Style Sheet or (5) PUT MA GUNS ON!

So far it seems to work ok. Do let me know if you encounter any problems. Assuming there's no adverse feedback, I'll probably STICK IT IN Hontou ni Taihen desu in the next few days.

Related posts:

  1. Ending the vigil, letting in the light
  2. Kei-ni hashinsuru!
  3. Still grappling with Google Reader

Posted by

Comments (7) Trackbacks (0)
  1. Glad it worked! I searched for “yuri” and Google quickly returned 424 results ranked in order of… relevance =3.

  2. Yuri is *always* relevant. LOL

    Thanks for the great instructional post!

  3. Haha, nice improvement. I see yuri, shizu-sama, and oneesama are of the appropriate size! Hinagikuism is a little small tho, need more posts about it~

  4. Hey Zyl, I just made a correction to the tutorial. If you set Ad Location to “Top and Bottom” instead of the default (top and right), you can have a width of 500 pixels. Since your content width seems to be 600 pixels, you could leave the sidebar in if you redo the code with a width of say 560 and paste it in again.

  5. Ashram, thanks for the test drive and feedback. Let’s hope the second season of the anime and the continuing manga will continue to feed the Hinagikuism!

    Kabitzin, much appreciated. I’ve tried using new Google adsense code but it doesn’t seem to be coming through. Granted the change won’t be immediate and Adsense is having maintenance today too…

  6. You probably have to repaste the widget code too. Lemme know if that still doesn’t help.

  7. YES! It works!
    YES! Kabitzin is the best!
    YES! I am (Boris) Invincible! |_(o~o)_|


Leave a comment

(required)

No trackbacks yet.