# Champs recherche WordPress / bbPress

- Link: https://dolys.fr/forums/topic/champs-recherche-wordpress-bbpress/
- Published: 2016-05-06T07:33:07+02:00
- Author: nam1962

La recherche bbPress n&rsquo;est pas directement intégrée à WordPress. Pour que cela soit, il suffit d&rsquo;ajouter ce pavé au functions.php de votre thème : function my_add_bbp_to_search( $post_type ) { $post_type['exclude_from_search'] = false; return $post_type; } add_filter( 'bbp_register_forum_post_type', 'my_add_bbp_to_search' ); add_filter( 'bbp_register_topic_post_type', 'my_add_bbp_to_search' ); add_filter( 'bbp_register_reply_post_type', 'my_add_bbp_to_search' ); function my_bbp_get_theme_compat_templates($templates){ if ( isset($_GET['s']) ) { array_unshift($templates, 'search.php'); } return $templates; } add_filter( 'bbp_get_theme_compat_templates', 'my_bbp_get_theme_compat_templates'); Source : https://wpchannel.com/integrer-bbpress-resultats-recherche-wordpress/ Grâce à ce tweak, doLys a une recherche fonctionnelle 😉 Truc supplémentaire : pour automatiser les mises à jour de vos plugins, ajoutez dans le même functions.php cette ligne : add_filter( 'auto_update_plugin', '__return_true' ); // Plugins
