lil-bee: the randomizer

Blog Search Bar for Classic Template
Friday, April 12, 2013 | 4:21 am | Comment ⇢
Meh post title but I had a hard time trying to find a code to do this so thought I'll be pretty straightforward so others can find this if they need to. Plus I haven't done a tech geek post in a while so .. ;D

I've been looking for a code to search my blog posts for a while. Found some generic HTML codes to do this online but they just wouldn't work / wouldn't display the results in an appropriate place, etc. So I had given up ... till just now when I randomly thought that I really need a search bar and there HAS to be one out there somewhere that works! Well, after much Googling around, I looked at some HTML template files and found the code, tried it out .. and it worked! It was super easy and oh so useful (especially if you randomly chat about EVERYTHING like moi) so I thought I'd share.

I wanted my search bar to appear on the side, so I added this code right below my <td> codes for the sidebar section (and again, I'm assuming that if you are playing around with HTML, you know where to put this for your own template). I didn't want a search button so I omitted that. I also wanted it centered so I used the <center> code. And thats it. Search results show relevant blog posts where my posts are normally coded to appear so I didn't have to do anything on that front. Hope it helps!

If you wanna include the search button, add this code to the code above BEFORE the </form> code. You can change the value from Search or anything else you want that button to display - a dot, any other text, etc. Heck, you can even have a search magnifier image as your button, just use some img codes and you're good to go (I think, don't quote me!).

Post a Comment

old | new