From 1f4059cbaf03f37d69f2aee832a7a48e560a0d6a Mon Sep 17 00:00:00 2001 From: Nonimart Date: Tue, 14 Oct 2025 15:54:42 +0200 Subject: [PATCH] FEATURE Introducing block recommandations --- functions.php | 1 + includes/featured-revues.php | 27 ++++++++ resources/css/app.css | 1 + resources/css/blocks/recommandations.css | 69 +++++++++++++++++++ .../revues/revue-recommandation-card.php | 27 ++++++++ 5 files changed, 125 insertions(+) create mode 100644 includes/featured-revues.php create mode 100644 resources/css/blocks/recommandations.css create mode 100644 template-parts/revues/revue-recommandation-card.php diff --git a/functions.php b/functions.php index 1134b5e..eb2501a 100644 --- a/functions.php +++ b/functions.php @@ -13,3 +13,4 @@ require_once(__DIR__ . '/includes/article.php'); require_once(__DIR__ . '/includes/api.php'); require_once(__DIR__ . '/includes/renderPostsDatas.php'); require_once(__DIR__ . '/includes/utilities.php'); +require_once(__DIR__ . '/includes/featured-revues.php'); diff --git a/includes/featured-revues.php b/includes/featured-revues.php new file mode 100644 index 0000000..2ba739c --- /dev/null +++ b/includes/featured-revues.php @@ -0,0 +1,27 @@ + __('Revues Conseillées', 'dynamiques'), + 'menu_title' => __('Revues Conseillées', 'dynamiques'), + 'parent_slug' => 'edit.php?post_type=revues', + 'menu_slug' => 'revues-options', + 'capability' => 'manage_options', + 'redirect' => false, + )); +} + +add_action('acf/init', 'dynamiques_register_featured_revues_options_page'); + + diff --git a/resources/css/app.css b/resources/css/app.css index 96ea9f7..74db281 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -52,3 +52,4 @@ @import './blocks/explore-tags.css'; @import './blocks/wp-block-pullquote.css'; @import './blocks/statistics-datas.css'; +@import './blocks/recommandations.css'; diff --git a/resources/css/blocks/recommandations.css b/resources/css/blocks/recommandations.css new file mode 100644 index 0000000..09c0974 --- /dev/null +++ b/resources/css/blocks/recommandations.css @@ -0,0 +1,69 @@ +.wp-block-dynamiques-blocks-nos-recommandations { + @apply bg-carhop-purple-100 py-24 px-12 xl:px-24; + .inner { + @apply max-w-screen-2xl mx-auto; + } + + .block-heading { + @apply text-primary flex flex-wrap gap-x-8; + + &__title { + @apply flex grow items-end justify-between gap-8 uppercase text-2xl md:text-4xl lg:text-5xl; + span { + @apply block shrink-0; + } + &:after { + @apply w-full z-20 bg-primary block mb-2 shrink; + height: 1px; + content: ' '; + } + } + + &__subtitle { + @apply text-lg font-bold uppercase nunito mb-6 w-full flex-wrap; + } + + .header-link { + @apply text-lg font-medium nunito flex items-center gap-3; + text-transform: none; + span { + @apply pt-1; + } + + svg { + @apply w-8 h-8; + transition: transform 0.3s ease-in-out; + path, + circle { + @apply stroke-primary stroke-2; + } + } + &:hover { + svg { + @apply rotate-45 translate-x-2; + } + } + } + } + + .recommandations-grid { + @apply grid lg:grid-cols-3 gap-16 pt-12; + } + + .revue-recommandation-card { + @apply flex flex-col gap-x-8 gap-y-2 bg-white p-8 border border-primary; + .content-meta { + @apply text-primary; + } + &__title { + @apply text-2xl; + } + &__thumbnail { + @apply p-4 border border-primary mt-8; + transform: rotate(2deg); + img { + @apply w-full h-48 object-cover; + } + } + } +} diff --git a/template-parts/revues/revue-recommandation-card.php b/template-parts/revues/revue-recommandation-card.php new file mode 100644 index 0000000..703862a --- /dev/null +++ b/template-parts/revues/revue-recommandation-card.php @@ -0,0 +1,27 @@ + + + + +

+ +
+ +
+ + + + +
+ <?php echo $alt; ?> +
+ +
\ No newline at end of file