-
AuthorPosts
-
October 12, 2013 at 7:21 am #174502
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.
October 12, 2013 at 10:46 am #174554Hi Pedro!
I marked this thread for Kriesi – I’m sure he already created some custom code for his child theme.
Best regards,
PeterOctober 14, 2013 at 10:26 am #175002Hi, 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-
This reply was modified 12 years ago by
Kriesi.
October 15, 2013 at 2:57 pm #175654Thanks 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; }October 15, 2013 at 2:58 pm #175655This reply has been marked as private.October 15, 2013 at 3:38 pm #175679Hey!
Please try to use
if( strpos($_SERVER["REQUEST_URI"], 'forums') !== false )
instead
October 15, 2013 at 3:41 pm #175681Now! Why could be the reason that before didn’t work?
Thank you anyways :)
October 15, 2013 at 3:49 pm #175683 -
This reply was modified 12 years ago by
-
AuthorPosts
- The topic ‘Ajax search button in forums’ is closed to new replies.
