h1Live Blog Search

Posted on August 24th, 2005 at 7:07 PM (3 years, 4 months ago)

I ripped some code outta the WordPress theme K2 (the sequel to the infamous theme Kubrick that comes bundled with WordPress) that allows you to see your search results as you type.

I’ve modified it a bit and my modifications are still a work in progress, but you can check it out in the search box to the right.

(It may take a second or two to display the results as it has to query each time you type, so be patient.)

5 Comments On This Post (Feed)

  1. Very Cool Viperbond007! I too had considered doing just this with my blog, but due to time constraints I didn’t get around to it. How difficult was it for you to “cut and paste” it? Any pitfalls I should watch for?

  2. Oops! Sorry about the mispelling of your name, I got the order confused ;-)

  3. Gotta love when your PC locks up after typing out a small essay. <_ <

    I also notice that you’ve implemented it into your blog already. :D However, I’ll still re-type out my comment (I wrote it down on paper off my frozen screen, lol) as some of it still applies.

    lol, it’s okay, I actually used to go by ViperBond007 like 7 years back. ;)

    Anyway, it wasn’t too hard, but it was kinda pain to get it to validate while keeping auto-complete off. It had been using autocomplete="off" on the input field, but that’s not valid code. I also couldn’t just pick a random, changing string for each page load as there was no easy way to get the string to both the Javascript in the header of the page as well as the form.

    I ended up naming the search field s and then the UNIX timestamp for the current time (without seconds as it often takes more than 1 second to generate my blog) as the name of the input field. This makes it basically different each time you load a page (give or take), making auto-complete not work on it.

    I then though had to have the form post to a script that’d accept the changing input field name and then redirect to the WordPress search results page in a format that WordPress could understand.

    It sounds WAY more complicated than it really was, and I’ll share the code if you want.

    It’s still a work in progress though, especially since I didn’t realize that a new version of K2 was out. I also cannot get it to go over the contents of my sidebar. It just keeps pushing the contents down and it’s driving me nuts. lol

  4. Hello there! :)

    Can I use your live search plugin?
    Where can I found it? :)

    Thx for your time.

  5. Cristian Chelaru on October 2nd, 2006 at 8:03 AM wrote:

    Can I use your live search plugin?
    Where can I found it? :)

    It’s not a plugin. As said in the post, I stole the CSS/PHP from the K2 theme.

    You might try this plugin though…

Leave a Comment

If you would like to leave a trackback to this entry, use this URL. This is also a Gravatar enabled blog, so if you have a Gravatar account, use it!

 

Click Here to Quote Any Selected Text On The Page

XHTML: You can use these tags in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

#