ThemeShaper Forums » Thematic


Style Search Bar and Button / change title of widget

(2 posts)
  • Started 10 years ago by theBlogButler
  • Latest reply from Paulo
  • This topic is not resolved
  1. theBlogButler

    I need to style the search bar for a project as well as change the submit button and modify the title. I can't modify the search on the title so I'm wondering how I can do this and style the bar up - dimensions, background color, don't want border, I want to remove the text in the search bar, etc.


    Posted 10 years ago #
  2. Paulo

    I just finish this (localhost sorry)

    //==================== Custom Search Box  ============================
    //Search box text
    function childtheme_search_text() {
    return "Type what are you looking for....";
    add_filter('search_field_value', 'childtheme_search_text');
    function childtheme_search_box() {
     { ?>
    <!-- Search HTML code -->
        <form id="searchform" method="get" action="<?php bloginfo('home') ?>">
        	<input type="text" onfocus="if (this.value == 'Search') {this.value = '';}" onblur="if (this.value == '')  {this.value = 'Search';}" id="s" name="s" value="">
        	<input type="image" tabindex="2" value="search" name="searchsubmit" id="searchsubmit">
    <!-- End of Code -->
    <?php }
    } // End of Search Bar
    //Remove the default button text
    function childtheme_search_submit() {
    return '<input id="searchsubmit" name="searchsubmit" type="submit" value="' . __('', 'thematic') . '" tabindex="2" />';
    add_filter('thematic_search_submit', 'childtheme_search_submit');
    //======================= End custom search ===============================

    And the CSS:

    .widgettitle { display: none; }
    #searchform {
    	border:1px solid #D9D9D9;
    	height: 32px;
    #s {
    	background:none repeat scroll 0 0 transparent;
    	border:0 none;
    	font-style: italic;
    #searchsubmit {
    	background:url(images/search-icon.jpg) no-repeat;
    	border:0 none;
    	width: 26px;
    	height: 24px;

    Hope it helps :)

    Posted 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.