Jump to content


Photo
- - - - -

Editing the Search Field Text


Best Answer bxbmedia , 16 July 2012 - 05:00 PM

Hey @buwebservices,

You needed to look a little deeper at the code behind the pagelines_search_form function.

Just add this filter to your child theme's or pagelines customize plugin's functions.php file.

Just change where it says: "YOUR SEARCH FIELD TEXT" to whatever text you want there!

 add_filter('pagelines_search_form','override_search_form');
	function override_search_form() {
	
		$searchfield = sprintf('<input type="text" value="" name="s" class="searchfield" placeholder="%s" />', 'YOUR SEARCH FIELD TEXT'); // modify here
	
		$searchform = sprintf('<form method="get" class="searchform" onsubmit="this.submit();return false;" action="%s/" ><fieldset>%s</fieldset></form>', home_url(), $searchfield);
	
		return $searchform;
	}
Go to the full post


  • Please log in to reply
2 replies to this topic

#1 buwebservices

buwebservices

    Member

  • Members
  • 10 posts
  • Country: Country Flag

Posted 16 July 2012 - 03:52 PM

I have been trying for days to edit the search field default text and nothing I have tried works. Nothing others have suggested works.

I have this searchform.php copied from the main template into my child template, but I don't know what to put in this php page to change the default text. Any help would be much appreciated.

Here is what is currently in searchform.php file

Please Login or Register to see this Hidden Content



#2 bxbmedia

bxbmedia

    Advanced Member

  • Members

  • 79 posts
  • LocationAnn Arbor, MI

Posted 16 July 2012 - 05:00 PM   Best Answer

Hey @buwebservices,

You needed to look a little deeper at the code behind the pagelines_search_form function.

Just add this filter to your child theme's or pagelines customize plugin's functions.php file.

Just change where it says: "YOUR SEARCH FIELD TEXT" to whatever text you want there!

Please Login or Register to see this Hidden Content



#3 buwebservices

buwebservices

    Member

  • Members
  • 10 posts
  • Country: Country Flag

Posted 16 July 2012 - 05:13 PM

This worked perfectly! Thank you so much!