Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Sidebars & Widgets (http://forum.bytesforall.com/forumdisplay.php?f=14)
-   -   Removing Magnifying Glass Icon from Search Widget (http://forum.bytesforall.com/showthread.php?t=175)

HenryGomez Feb 3, 2009 08:19 AM

Removing Magnifying Glass Icon from Search Widget
 
Is there a way I can remove the magnifying glass Icon from the search widget?

Flynn Feb 3, 2009 08:55 AM

In searchform.php, delete this:

PHP Code:

<td class="searchbutton">
<input name="submit" value="Search" type="image" src="<?php echo get_bloginfo('template_directory'); ?>/images/magnifier2-gray.gif" style="display: block; border:none; padding: 0 0 0 5px; margin: 0;" />
</td>


HenryGomez Feb 3, 2009 10:50 AM

All of the code you reproduced there or only the stuff in blue? I want a button instead of the icon.

Flynn Feb 3, 2009 11:38 AM

You didn't mention that you want a button. The search form would still have worked - by pressing [Enter] on the keyboard.

To replace the magnifier with a HTML button, replace, in searchform.php:

PHP Code:

<td class="searchbutton">
<input name="submit" value="Search" type="image" src="<?php echo get_bloginfo('template_directory'); ?>/images/magnifier2-gray.gif" style="display: block; border:none; padding: 0 0 0 5px; margin: 0;" />
</td>

with

PHP Code:

<td class="searchbutton">
<
input type="submit" class="button"  value="Search" />
</
td

The value="Search" can be any text. The whole form should adjust to the width of the sidebar. The longer you make the text the shorter the input field should get. value="&nbsp;" (button without text) or value="&raquo;" (button with right angle quote as text) should work as well if there's not much space in the sidebar.

HenryGomez Feb 3, 2009 04:16 PM

Worked like a charm. I hope you're the guy that gets the money in the tip jar. I left a little bit for you. I have another question coming up.

Flynn Feb 3, 2009 04:35 PM

Quote:

Originally Posted by HenryGomez (Post 773)
I left a little bit for you.

Thank you, Henry.

49Monsters Sep 24, 2010 12:36 PM

I'm trying to place my own button instead of the magnifying glass.

Searchform php:

<form method="get" class="searchform" action="<?php bloginfo('url'); ?>/">
<table class="searchform" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="searchfield">
<input type="text" class="text inputblur" value="<?php the_search_query(); ?>" name="s" />
</td>
<td class="searchbutton">
<input name="submit" value="search" type="image" src="<?php echo get_bloginfo('template_directory'); ?>style="display: block; border:none; padding: 0 0 0 5px; margin: 0px;" />
</td>
</tr></table>

Need to know how to delete the word search and still be able to place my button and the end of the box.
</form>


CSS Insert:

.searchfield input {
color: #781351;
background: #fee3ad; top left;
border: 2px solid #8718c5;
width: 180px;
padding: 0px 0px 5px 0px;
margin-bottom: 10px; margin-right: 0px;
}

.searchbutton {
background: url(./wp-content/themes/atahualpa353/images/search_go.png) top left; no-repeat;
}


Need to know how to get rid of the word Search and still be able to have my new button positioned at the end of the box. Right now, somehow I have four images of my button showing with "Search" over printing them.:confused:


All times are GMT -6. The time now is 09:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.