✨feature: Homepage filter template
This commit is contained in:
20
templates/filter-homepage.php
Normal file
20
templates/filter-homepage.php
Normal 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>
|
||||
Reference in New Issue
Block a user