Widget breaks search
-
Hello, here’s the code I’m using.
<?php $searchtext = get_search_query(); if($searchtext == ''){ $searchtext = 'Search...'; } ?> <div id="search"><form method="get" id="searchform" action="<?php bloginfo('url'); ?>/"> <div> <input type="text" value="<?php echo $searchtext; ?>" name="s" id="searchfield" onfocus="if (this.value==this.defaultValue) this.value='';" /> <input type="image" src="wp-content/themes/active/images/go.jpg" id="searchsubmit" value="Search" /> </div> </form></div> <div class="sidedivider"></div>
When I put it in the sidebar.php file, it works fine. When I copy the same block to a new Widget (via the text option, then pasting it in) the search completely breaks.
Is this because I’m putting PHP in one of these? Is there a way to fix it?
Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Widget breaks search’ is closed to new replies.