latest changes
This commit is contained in:
15
search.php
Normal file
15
search.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
get_header();
|
||||
|
||||
$results = site()->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();
|
||||
Reference in New Issue
Block a user