Hi,
I tried to limit search only title because a visitor clicks on search icon without typing any thing, then my website list all category id page, ….
I searched I saw an option from David :https://generatepress.com/forums/topic/limit-search-to-page-titles/
I used this code (https://developer.wordpress.org/reference/hooks/posts_search/#user-contributed-notes) and it leads to error below:
Error:
Warning: Parameter 2 to __search_by_title_only() expected to be a reference, value given in /home/…../public_html/wp-includes/class-wp-hook.php on line 286
Warning: Parameter 2 to __search_by_title_only() expected to be a reference, value given in /home/…../public_html/wp-includes/class-wp-hook.php on line 286
How can I deal with this case?