-
AuthorPosts
-
September 17, 2017 at 2:10 pm #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
September 19, 2017 at 5:21 pm #853948Hey 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ünterSeptember 20, 2017 at 4:11 pm #854430Hello 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
September 20, 2017 at 4:22 pm #854434Hi!
Please edit functions.php file in Appearance > Editor and add the code Gunter posted to very bottom of the file.
Best regards,
YigitAugust 26, 2019 at 3:37 pm #1131003It 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?
August 27, 2019 at 3:02 pm #1131331Hi,
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,
YigitSeptember 13, 2019 at 9:05 pm #1138191Hi,
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.
September 17, 2019 at 12:19 pm #1139072Hi,
@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,
YigitSeptember 20, 2019 at 4:41 pm #1140246Thank you, Yigit!
September 20, 2019 at 5:02 pm #1140251Hi,
Did you need additional help or shall this topic be closed?
Best regards,
Jordan ShannonSeptember 20, 2019 at 5:50 pm #1140278No, that’s it. You answered my question. Thank you again.
September 20, 2019 at 6:05 pm #1140291Hi,
If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Changing text "Search" from the search on header’ is closed to new replies.