feature: Homepage filter template

This commit is contained in:
Keith Solomon
2025-02-06 15:17:04 -06:00
parent 7716cc8a15
commit ea95f81ac6
3 changed files with 148 additions and 30 deletions

View File

@@ -0,0 +1,20 @@
<?php if (!defined('ABSPATH')) { exit; } ?>
<form id="homepage-filter" action="<?php echo site_url('/browse-resources/'); ?>" method="GET">
<?php
$resource_types = get_terms(['taxonomy' => 'resource_type']);
if (!empty($resource_types)) :
?>
<select name="resource_type">
<option value="">All Types</option>
<?php foreach ($resource_types as $type) : ?>
<option value="<?php echo esc_attr($type->slug); ?>"><?php echo esc_html($type->name); ?></option>
<?php endforeach; ?>
</select>
<?php endif; ?>
<input type="text" name="search" placeholder="Search resources...">
<button type="submit">Search</button>
</form>