Title: Using Search Code in Widget
Last modified: August 21, 2016

---

# Using Search Code in Widget

 *  [sgreenq](https://wordpress.org/support/users/sgreenq/)
 * (@sgreenq)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/using-search-code-in-widget/)
 * So this piece of code works for search results wherever I put it on my site…
 *     ```
       <div class="search">
       			<form action="<?php echo home_url(); ?>" name="SearchForm" method="get">
       				<input type="text" name="s" maxlength="64" id="SearchForm" value=" " placeholder="Search" />
       			</form>
       			<div class="srch_btn" onclick="SearchForm.submit()"><img src="/wp-content/themes/switch/images/search-img.png" width="16" height="16"></div>
       		</div>
       ```
   
 * …except when I place that same code inside a text-widget. The issue is that I’m
   using a top panel sliding plugin for the header, so that’s where I need to include
   the search code. Unfortunately it returns as “<?s=” (leading to a 404 error) 
   instead of “?s=”. I have googled all over and have not found any reason for that
   left carrot.
 * Site is temp.afrontporchdesign.com. Click on the top menu bar and the search 
   button is in the upper right.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/using-search-code-in-widget/#post-3683501)
 * You cannot use PHP code in a standard Text widget.
 *  Thread Starter [sgreenq](https://wordpress.org/support/users/sgreenq/)
 * (@sgreenq)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/using-search-code-in-widget/#post-3683538)
 * Thanks, probably should have known that

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using Search Code in Widget’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [sgreenq](https://wordpress.org/support/users/sgreenq/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/using-search-code-in-widget/#post-3683538)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
