Wordpress Search.php Issue

Hi,

I change the PHP code of the Search.php to have my search results appear as a column.
It works fine but the only issue is that when there is no match found it still show results of a few pages and link.
The code is here https://pastebin.com/cRV2WbkV
the part I added start with if(!empty($_GET[‘s’])) and finish by echo “

”.$blog->html()."
";

}

Could you please help? I think the condition if no result found is missing?
Thanks

Olivier

Then I would say it is finding *something… You would need to tweak the query itself if you want more concise results rather than what it is returning.

Hi,

Thanks for your answer.
Do you know what I can add?
I’m not a PHP expert. I took the code from a forum.
Thanks

Olivier

Sponsor our Newsletter | Privacy Policy | Terms of Service