From 24c4dadbca85ca66e39e0dbb297affaaf945cdac Mon Sep 17 00:00:00 2001 From: Antoine M Date: Mon, 13 Apr 2026 16:59:54 +0200 Subject: [PATCH] FEATURE handling fonds archives --- archive-fonds-archives.php | 36 ++++++++++++ .../fonds-archives/archive-header.php | 15 +++++ .../fonds-archives/archive-post-grid.php | 40 +++++++++++++ .../fonds-archives-grid-toolbar.php | 58 +++++++++++++++++++ 4 files changed, 149 insertions(+) create mode 100644 archive-fonds-archives.php create mode 100644 template-parts/post-types/fonds-archives/archive-header.php create mode 100644 template-parts/post-types/fonds-archives/archive-post-grid.php create mode 100644 template-parts/post-types/fonds-archives/fonds-archives-grid-toolbar.php diff --git a/archive-fonds-archives.php b/archive-fonds-archives.php new file mode 100644 index 0000000..95e2600 --- /dev/null +++ b/archive-fonds-archives.php @@ -0,0 +1,36 @@ + + + + +
+ + + + + + 'fonds-archives', + 'post_amount' => -1, + 'grid_title' => 'Trouver un fonds d\'archives', + )); ?> + + + + + + + + + + + + + + +
+ + 'Fonds d\'archives', + 'subtitle' => 'Explorer les fonds conservés au CARHOP', + 'description' => 'Vous trouverez ci-dessous la liste des fonds d’archives conservés au CARHOP. Les inventaires disponibles sont accessibles via notre base de données, qui permet des recherches multicritères et, pour certaines pièces, une prévisualisation de documents numérisés.', + 'cover' => array( + 'url' => get_stylesheet_directory_uri() . '/resources/img/covers/carhop-page-fonds-archives-cover.svg', + 'alt' => 'Revues' + ), + 'has_overlap' => false, + 'background_style' => 'sliced', + 'cta' => array( + 'title' => __('Consulter notre politique de collecte', 'carhop'), + 'url' => '#prochaines-expositions', + ) +)); diff --git a/template-parts/post-types/fonds-archives/archive-post-grid.php b/template-parts/post-types/fonds-archives/archive-post-grid.php new file mode 100644 index 0000000..ce40864 --- /dev/null +++ b/template-parts/post-types/fonds-archives/archive-post-grid.php @@ -0,0 +1,40 @@ + $current_post_type, + 'posts_per_page' => $post_amount, + 'post_status' => 'publish', +); + + +$posts_query = new WP_Query($query_args); + +?> + + +
+

+
+ + $posts_query, + 'current_post_type' => $current_post_type, + 'etiquette_active_filter_slug' => $etiquette_slug, + )); ?> + +
    + have_posts()) : ?> + have_posts()) : $posts_query->the_post(); ?> + get_the_ID(), + )); ?> + + +
+
+
\ No newline at end of file diff --git a/template-parts/post-types/fonds-archives/fonds-archives-grid-toolbar.php b/template-parts/post-types/fonds-archives/fonds-archives-grid-toolbar.php new file mode 100644 index 0000000..e01e504 --- /dev/null +++ b/template-parts/post-types/fonds-archives/fonds-archives-grid-toolbar.php @@ -0,0 +1,58 @@ +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); +$tags = get_terms(array( + 'taxonomy' => 'etiquettes', + 'hide_empty' => true, + 'object_ids' => $post_ids, +)); + +?> + +
+ +

+ + + + 1) : ?> + + labels->name; ?> + + + + labels->singular_name; ?> + + +

+ + +
+ +

Rechercher par ordre alphabétique

+
+ + + +
+
+
\ No newline at end of file