need to add <hr /> tag after the title
register_sidebar() in functions.php;
http://codex.wordpress.org/Function_Reference/register_sidebar
'after_title' => '</h2><hr />'
(untested)
Also I need to change the wording of the search form widget submit button to “Go” instead of “Search”.
try a filter function added to functions.php of your theme:
for instance:
add_filter('get_search_form', 'new_search_button');
function new_search_button($text) {
$text = str_replace('value="Search"', 'value="Go"', $text);
return $text;
}
I also added <hr /> after the title of the search widget.
Will this be a problem for any dynamic solution that adds <hr /> to each widget?
you may end up with two <hr /> after the search.
Thread Starter
hp3
(@hp3)
Thanks, both of these suggestions worked except for adding the <hr /> to the search form title.
I first removed searchform.php template from my theme files. Then I modified the code in the functions.php as you suggested. This added the <hr /> after all widget titles in the primary side bar, except the title of the default search form.
The filter replaced the wording of the button “search” with “go”. I added a second string_replace in the filter to reword the Search form widget title and add a <hr />.
However, I am wondering what is different about the search form widget that the title did not include <hr /> tag, eventhough I modified the after_title argument to include the <hr />, while the other widget titles correctly did include the <hr />. I had to resort to a search_replace to include the <hr /> for the Search form widget title. Any suggestions?
I also tested with a searchform.php template and it seems that wordpress overrides any default widget code with the code in the searchform.php, so I did not end up with two <hr /> tags. I assume register_sidebar() does not apply when there is a corresponding template file for the widget. Since the searchform.php is not really necessary I removed it and will instead rely upon modifications to the functions.php file.
Thanks again for your helpful suggestions.