FEATURE introducing component
This commit is contained in:
parent
a29ddbd36c
commit
6bbaaefe85
|
|
@ -0,0 +1,66 @@
|
||||||
|
<?php
|
||||||
|
$current_post_type = $args['current_post_type'] ?? get_post_type();
|
||||||
|
$posts_query = $args['posts_query'] ?? null;
|
||||||
|
$post_count = $posts_query->post_count;
|
||||||
|
$current_post_type_obj = get_post_type_object($current_post_type);
|
||||||
|
|
||||||
|
$etiquette_active_filter_slug = $args['etiquette_active_filter_slug'] ?? null;
|
||||||
|
|
||||||
|
$post_ids = wp_list_pluck($posts_query->posts, 'ID');
|
||||||
|
|
||||||
|
$types = get_terms(array(
|
||||||
|
'taxonomy' => 'type',
|
||||||
|
'hide_empty' => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
$authors = get_authors_linked_to_posts($post_ids);
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="post-grid__toolbar">
|
||||||
|
<div class="search-by">
|
||||||
|
<p class="search-by__label">Filtrer par</p>
|
||||||
|
<div class="search-by__buttons">
|
||||||
|
<button data-filter="occurence" aria-selected="true">Mot clé</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2 class="post-count">
|
||||||
|
<span class="post-count__count">
|
||||||
|
<?php echo $post_count; ?>
|
||||||
|
</span>
|
||||||
|
<?php if ($post_count > 1) : ?>
|
||||||
|
<span class="post-count__text">
|
||||||
|
<?php echo $current_post_type_obj->labels->name; ?>
|
||||||
|
</span>
|
||||||
|
<?php else : ?>
|
||||||
|
<span class="post-count__text">
|
||||||
|
<?php echo $current_post_type_obj->labels->singular_name; ?>
|
||||||
|
</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<div class="post-grid__toolbar-actions" data-post-type="<?php echo $current_post_type; ?>">
|
||||||
|
<div class="search-bar">
|
||||||
|
<input type="text" placeholder="<?php _e('Rechercher par mot-clé', 'dynamiques'); ?>">
|
||||||
|
<button class="search-bar__reset-button" id="reset-search">
|
||||||
|
<img src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-reset-search-cross-green.svg" alt="<?php _e('Réinitialiser', 'carhop'); ?>">
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<select name="auteurs">
|
||||||
|
<option value=""><?php _e('Tous·tes les auteur·e·s', 'dynamiques'); ?></option>
|
||||||
|
<?php foreach ($authors as $author) : ?>
|
||||||
|
<option value="<?php echo $author->ID; ?>"><?php echo $author->post_title; ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<select name="sort_by">
|
||||||
|
<option value="date_desc" selected><?php _e('Voir les dernières actualités en premier', 'dynamiques'); ?></option>
|
||||||
|
<option value="date_asc"><?php _e('Voir les actualités anciennes en premier', 'dynamiques'); ?></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
Loading…
Reference in New Issue
Block a user