::  Home  

How to Make Wordpress Search Button Image

Posted in Wordpress
On Sunday, November 5, 2006

This is how to replace default wordpress search with an image/icon.

Open your searchform.php, and search for this lines:
(note, I changed “<>” to “[]”, to make the code readable)

[form method="get" id="searchform" action="[?php echo $_SERVER['PHP_SELF']; ?]"] [div][input type="text" value="[?php echo wp_specialchars($s, 1); ?]" name="s" id="s" /][input type="submit" id="searchsubmit" value="Go" /] [/div] [/form]

Change to:

[form method="get" id="searchform" action="[?php echo $_SERVER['PHP_SELF']; ?]"] [div][input type="text" value="[?php echo wp_specialchars($s, 1); ?]" name="s" id="s" /][input type="image" src="images/icon/search.gif" name="search" alt="Search" class="button" /] [/div] [/form]

Place your search.gif on [BASE DIR]/images/icon/

Leave a Reply


Possible Related Entries:
[EarthSync roll-b]
Caution:
Non-English page is generated by an automatic translation software which can rise inaccurate translation.
Consider to view the original English version via link at the bottom of this page.