Hi,
I need to force Enfold to show all search results even if search query ( ?s= ) is empty.
That would be the default Wp behaviour, actually.
Any help?
Hey aledef,
Thank you for using Enfold.
Could you explain the issue further? The theme doesn’t alter the default search functionality.
Best regards,
Ismael
Hi Ismael,
if you do search for an empty search query ( ?s= ) when Enfold is actvive then you get no results and a page whose title is: “To search the site please enter a valid term”. Please see here:
https://kriesi.at/themes/enfold/?s=
If you do the same when a default theme ( Twenty nineteeen, Twenty Seventeen, Twenty Sixteen, etc.. ) is active then you get all results, which is default WP behaviuor. I tryed this on a test website with Wp up to date and no other plugin active.
It looks like Enfold actually alters the default search functionality.
Hi,
I see. In the search.php template, the theme has this condition or logic.
if(!empty($_GET['s']) || have_posts())
It says that if the search query is not empty or have posts to display, get the search template. It’s not going to display anything if the search is empty. Maybe, the search template on the default themes are different.
Best regards,
Ismael
Hi,
I guess I’ll have to modify search.php in child theme then.