Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #371586

    Please advise on how to add custom search messages to my child theme – functions file rather than editing the functions-enfold or loop-search files.

    Thanks

    #371601

    Hi xyzb!

    Thank you for coming back.

    In functions.php (child or parent theme) add the following:

    
    add_filter('avf_ajax_search_messages', 'my_search_text', 10,2);
    		
    function my_search_text ($search_messages, $search_query)
    {
    //   possible values to change:
    //   
    //	$search_messages = array(
    //	            'no_criteria_matched' => __("Sorry, no posts matched your criteria", 'avia_framework'),
    //	            'another_search_term' => __("Please try another search term", 'avia_framework'),
    //	            'time_format'         => get_option('date_format'),
    //	            'all_results_query'   => http_build_query($_REQUEST),
    //	            'all_results_link'    => home_url('?' . http_build_query($_REQUEST)),
    //	            'view_all_results'    => __('View all results','avia_framework')
    //            );
    	
    	$search_messages ['no_criteria_matched'] = 'your message text to replace';
    	
    	return $search_messages;
    	
    }
    

    Enter a line for each message to replace.

    Cheers!
    Günter

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.