Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #853066

    Hi Enfold,

    I added a search bar to my site ‘s header using “Append search icon to main menu
    If enabled a search Icon will be appended to the main menu that allows the users to perform an ‘AJAX’ Search”

    It works well but the drop down upon clicking the magnifier says “Search”. How can i change it to another text? Thanks

    #853948

    Hey ex0rcist88,

    Thank you for using our theme.

    Please add following code to Functions.php file of your child theme (or parent theme, if not using a child theme)- you can use Dashboard -> Appearance > Editor and change ‘My Search’:

    
    add_filter('avf_frontend_search_form_param', my_frontend_search_form_param, 10, 1 );
    
    function my_frontend_search_form_param( array $params )
    {
    	$params['placeholder'] = __('My Search','avia_framework');
    	
    	return $params;
    }
    
    

    Best regards,
    Günter

    #854430

    Hello Günter,

    I dont see My search. Only Loop-Search, Search Form, Search Results under Editor. Tried adding the above to Search Form but didn’t seem to work. Which file is it exactly and where do I add it?

    Thanks

    #854434

    Hi!

    Please edit functions.php file in Appearance > Editor and add the code Gunter posted to very bottom of the file.

    Best regards,
    Yigit

    #1131003

    It looks like this function will cause a PHP error

    PHP Warning: Use of undefined constant my_frontend_search_form_param – assumed ‘my_frontend_search_form_param’ (this will throw an Error in a future version of PHP)

    Anyone else get this?

    #1131331

    Hi,

    Please use the code as following

    add_filter('avf_frontend_search_form_param', 'my_frontend_search_form_param', 10, 1 );
    
    function my_frontend_search_form_param( array $params )
    {
    	$params['placeholder'] = __('My Search','avia_framework');
    	
    	return $params;
    }

    Best regards,
    Yigit

    #1138191

    Hi,

    The functions.php code is helpful for editing the search box placeholder. However, we have a custom search box in a widget and then the traditional search icon on the navigation menu. How would I reference the css in the functions.php to edit only one of the search boxes?

    Please see private content for the URL of the website where we have the search magnifying glass on the nav menu and want to keep the word ‘search’ in the box there. Further down on the home page beneath the Layerslider is a large search box widget. We want the placeholder to be empty here. We used the code you recommended but it blanks out both placeholders.

    #1139072

    Hi,

    @GWS Please use following code instead

    function av_delete_search_text(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery("#search-3 input").attr("placeholder", "");
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'av_delete_search_text');

    Best regards,
    Yigit

    #1140246

    Thank you, Yigit!

    #1140251

    Hi,

    Did you need additional help or shall this topic be closed?

    Best regards,
    Jordan Shannon

    #1140278

    No, that’s it. You answered my question. Thank you again.

    #1140291

    Hi,

    If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Changing text "Search" from the search on header’ is closed to new replies.