Customizing the WordPress search field

Wordpress search field

A few readers have asked how I customized my search field. I had some help on this from Melvin, at All Forces, but I’ll pass the code on here.

The file you need to change is “searchform.php”. It’s located in your themes folder. Whenever I try to post the code here, wordpress tires to change it to an actual form field instead of displaying the code. So, I’ll just make the code available for download and you can look at the php file. It basically just involves changing the input type from ‘text’ to ’search’, and adding a little javascript to put the text in, and take it out when the field is selected.

In Safari, the field shows up as a nice little OS X style input box (may be only Safari 2.0). In other browsers is shows up as a standard rectangular box.

Click here to download my searchform.php file. Leave a comment on this post if you have any questions.

Thursday, August 11th, 2005 General

1 Comment to Customizing the WordPress search field

  1. Thanks for sharing. It looks and works great.

  2. Joey on August 16th, 2005

Leave a comment

 

The Author

Paul Burd is a multimedia designer, and amateur photographer, living in San Francisco. More...

My Other Sites: My Portfolio | My Photoblog

Quickies

    # Intego warns against MacGuard malware

    Apparently, Macintosh antivirus software, MacGuard, is actually malware. Don't install it! Read more at Macworld.com.

    # 3G iPhone USB Power Adapter Recall

    Apple has found a defect in the new ultra-compact USB power adapter that ships with 3G iPhones. They're offering free exchanges starting 10/10/2008. LINK

    # Free Macworld SF 2009 Expo Passes

    Macworld San Francisco 2009 will be held on January 5th-9th. You can get free Exhibit-Only passes when registering if you use promo code, MKA31884, before 9/26/2008.

    # Adobe Releases Lightroom 2

    Yay! Adobe released Lightroom 2 this morning. I'm a big fan of Lightroom and this version offers some welcome enhancements. An upgrade will cost you $99. Regular price is still $299.

    If you want a guided tour, the National Association of Photoshop Professionals (NAPP) has produced a whole series of videos outlining the new features. You can see them here.

    # Get the most out of your Macbook battery

    Apple has posted a Quick Tip video on optimizing battery performance of your Macbook or Macbook Pro.

Categories