I have seen that in the forum you are using the ajax search button (not the search, but the same appearance). How I can implented?
Thank you.
Hi Pedro!
I marked this thread for Kriesi – I’m sure he already created some custom code for his child theme.
Best regards,
Peter
Hi, I am using this filter function in my child themes functions.php file:
add_action('avf_frontend_search_form_param', 'kriesi_forum_search',9); function kriesi_forum_search($params) { if( strpos($_SERVER["REQUEST_URI"], 'forums') !== false ) { $params['ajax_disable'] = true; $params['search_id'] = "bbp_search"; $params['placeholder'] = "Search Forums"; } return $params; }
The if( strpos($_SERVER["REQUEST_URI"], 'forums') !== false )
checks if the url contains the word “forums” and if thats the case changes the search to a bbpress search. might be necessary for you to check for another keyword (for example “forum” ) or omit the check to activate it globaly…
Regards,
Kriesi
Thanks Kriesi, but is not working in my case. I have the keyword “forums”, I change it, and is not changing at all.
This is the code that I type:
add_action('avf_frontend_search_form_param', 'kriesi_forum_search',9);
function kriesi_forum_search($params)
{
if( strpos($params['form_action'], 'forums') !== false )
{
$params['ajax_disable'] = true;
$params['search_id'] = "bbp_search";
$params['placeholder'] = "Search Forums";
}
return $params;
}
Hey!
Please try to use
if( strpos($_SERVER["REQUEST_URI"], 'forums') !== false )
instead
Now! Why could be the reason that before didn’t work?
Thank you anyways :)