StudioPress Community Forums

StudioPress Community Forums (http://www.studiopress.com/support/index.php)
-   General Discussion (http://www.studiopress.com/support/forumdisplay.php?f=7)
-   -   Search Function (http://www.studiopress.com/support/showthread.php?t=13851)

valeryvie 09-12-2009 03:03 AM

Search Function
 
Hi :-)

I want to move the SEARCH that appears in the widget area to the 468X60 Header Area Box -- where can I find the code for the search box to place in this area?

Thanks and thrive...

Valery

Brian Gardner 09-12-2009 05:59 AM

Re: Search Function
 
Try something like this:

Code:

<form id="searchform" method="get" action="<?php bloginfo('url'); ?>/">
<input type="text" value="<?php _e("Search this website...", 'studiopress'); ?>" name="s" id="s" onfocus="if (this.value == '<?php _e("Search this website...", 'studiopress'); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e("Search this website...", 'studiopress'); ?>';}" /><input type="submit" id="searchsubmit" value="<?php _e("GO", 'studiopress'); ?>" /></form>


valeryvie 09-14-2009 01:39 PM

Re: Search Function
 
Hi Brian :-)

Got some funny text in it... but have decided to leave the search where it is for now :-) Thanks anyway!

Thrive...

Valery ~

LenKutchma 09-14-2009 02:35 PM

Re: Search Function
 
Hi Valery,

If you're interested, this is how I did it. Basically you're swapping out the "header ad" stuff for the search box. Look in header.php for ...

Code:

    <div class="headerright">
        <?php if(get_theme_mod('468_header_ad') == 'Yes') { ?>
            <?php echo stripslashes (get_theme_mod('468_header_code')); ?>
        <?php } else { ?>
        <?php } ?>
    </div>

and modify it so that it looks like ...

Code:

    <div class="headerright">
            <form id="searchform" method="get" action="<?php bloginfo('url'); ?>/">
            <input type="text" value="<?php _e("Search this website...", 'studiopress'); ?>" name="s" id="s" onfocus="if (this.value == '<?php _e("Search this website...", 'studiopress'); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e("Search this website...", 'studiopress'); ?>';}" /><input type="submit" id="searchsubmit" value="<?php _e("GO", 'studiopress'); ?>" /></form>
    </div>

Then I went to the style sheet and looked for ...

Code:

.headerright {
        width: 478px;
        float: right;
        margin: 0px;
        padding: 10px 0px 0px 0px;
        }

and changed it to ...

Code:

.headerright {
        width: 230px;
        float: right;
        margin: 0px;
        padding: 20px 0px 0px 0px;
        }

I also deleted any reference of the header ad from tools/theme-options.php. If you do that be careful.

valeryvie 09-14-2009 02:40 PM

Re: Search Function
 
Thanks Len!!!!!

LenKutchma 09-14-2009 02:50 PM

Re: Search Function
 
You're welcome. :)

Brian Gardner 09-14-2009 05:25 PM

Re: Search Function
 
I second that - thanks Len, way to go above and beyond by sharing what you did. :)

Quote:

Originally Posted by LenKutchma
You're welcome. :)


09-24-2009 06:46 AM

Re: Search Function
 
Thanks for that. I just used the code you quoted to replace the RSS feed and comments icons with the search function.

careerbright 09-25-2009 01:36 PM

Re: Search Function
 
Hello Affiliate4Travel ,
Please can you tell me which file to edit to replace the RSSand Posts links.
I would like to do the same, have just downloaded the NEWS theme so not very familiar with the files, your tips will help!
Thanks!


All times are GMT -5. The time now is 01:21 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.