• Hi,

    I want to improve my search box appearance in top bar menu. I just want to increase width of search box, change the default text written in search box and change the background color of search box. Kindly help me. My website is [https://www.sabziadda.com/]

    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hey! Here is some CSS that will target the search bar:

    .kad-topbar-right #topbar-search .form-search {
        min-width: 500px;
        background: red;
    }

    You’ll want to change the properties of the search for your needs, but placing that into Theme Options> Advanced Settings.

    Changing the topbar search text will require a function in a child theme. Are you currently running a child theme?

    -Kevin

    Thread Starter sunnylife

    (@sunnylife)

    Yes, I am using child theme. Now what I will do to make changes to top bar search box?

    Thanks,
    Sunny

    Thread Starter sunnylife

    (@sunnylife)

    The above code is not working.

    In your custom CSS, you’re typing out comments like this //Comment.

    Comments in CSS should look like this /*COMMENT*/

    As for the function, you can try this one. I’m not super well versed in php, so there may be a better way to pull this off though.

    function custom_text_strings( $translated_text, $text, $domain ) {
    	switch ( $translated_text ) {
    		case 'Search' :
    			$translated_text = __( 'YOUR CUSTOM UPDATE CART TEXT HERE' );
    			break;
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'custom_text_strings', 20, 3 );

    let me know if this helps!

    -Kevin

    Thread Starter sunnylife

    (@sunnylife)

    Thank you so much.

    Now the code is working when I changes comment tag.

    How can change default text in search box?

    That function should change it, but it will change all instances of the word “Search” on your site.

    So if you want to hold out until we can get some input from the theme author, then that may not be a bad idea.

    -Kevin

    Thread Starter sunnylife

    (@sunnylife)

    Okay Kevin.

    I will wait.

    Actually, I just discussed this with the theme developer and this function should work just fine for you!

    Try adding it to your functions.php and let me know if it works for you.

    -Kevin

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Search box in top menu’ is closed to new replies.