Feeds

Where is the search function?

PerformancingAds
Submitted by Ken Wong on March 23, 2007 - 6:35pm in

Answer

Hi Ken,

You'll need to add the Wordpress search function. I put it in the sidebar of my homepage.

Ooops

Can't believe I missed that one. If either of you need help adding it, let me know. Email me at bmg1227@hotmail.com

Code

Here's how the code in the l_sidebar.php file should look:

<div id="l_sidebar">
<ul id="l_sidebarwidgeted">
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>

<form method="get" id="search_form" action="<?php bloginfo('home'); ?>/"><input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" /><input type="hidden" id="searchsubmit" value="Search" />
</form><br />

<li id="Recent">
<h2>Recently Written</h2>
<ul>
<?php get_archives('postbypost', 10); ?>
</ul>
</li>

Thanks everyone!

Brian, i've dropped you a mail. Thanks!

I have a problem with e

I have a problem with e search widget

Free Image Hosting at www.ImageShack.us

I don't know what happen with that... I've cheked the code and it's the same you got up there.
How could be this possible?

HELP PLEASE!

I'm having the same problem

I'm having the same problem as 3lie. I think it has to do with the widget implementation. It seems that currently the extra code for the search form in l_sidebar.php is not needed as it gets overwritten by the WordPress search widget (I'm just guessing this).

I'd like to have the same implementation of the search bar as the demo site. That is without the search button underneath (like 3lie's picture above).

I assumed removing the

<!--   -->

from

<!-- <input type="hidden" id="searchsubmit" value="Search" /> -->

would do the trick. But like I said above, no matter what you do to the l_sidebar.php, the searchbar remains the same. You can even delete all the code mentioned above by Brian Gardner and still have the searchbar function like in 3lie's picture.

Anyone have any insight on how to fix this problem?

I've found a solution I'm

I've found a solution I'm very happy with.

I've been able to add the Nightlife searchbar (without the "Search" button) to my sidebar while still being able to use my widgets. All you have to do is add the search code to l_sidebar.php above the widget caller conditional.

Basically:

ADD

<form method="get" id="search_form" action="<?php bloginfo('home'); ?>/">
<input type="text" class="search_input" value="To search, type and hit enter" name="s" id="s" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" />
<input type="hidden" id="searchsubmit" value="Search" />
</form><br />

ABOVE
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>

And that will in effect put the Nightlife searchbar above all your widgets while keeping your widget functionality.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <h2> <h3> <h4> <img> <div> <a> <em> <strong> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <span> <table> <td> <tr> <caption> <th> <hr> <pre> <br> <p> <object> <param> <embed> <strike>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
1 + 4 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.