getDefaultPosts(["id", "post_type", "title"]); $hasResults = count($results) > 0; echo site()->render("search-results", [ "searchTerm" => $_GET["s"] ?? "", "hasResults" => $hasResults, "pages" => array_filter($results, fn ($r) => $r["post_type"] === "page"), "products" => array_filter($results, fn ($r) => $r["post_type"] === "product"), ]); get_footer();