From 19027d2d4b6a2b39aa91c1b589bd003dc5f8ce3a Mon Sep 17 00:00:00 2001
From: Antoine M
+
+
+
+
+ ';
$link = $output;
$output = $icon . $link;
diff --git a/includes/post_types.php b/includes/post_types.php
index 21b14a0..7596846 100644
--- a/includes/post_types.php
+++ b/includes/post_types.php
@@ -57,7 +57,7 @@ function create_posttype()
],
'hierarchical' => true,
'public' => true,
- 'has_archive' => true,
+ 'has_archive' => false,
'show_in_rest' => true,
'menu_icon' => 'dashicons-pressthis',
'menu_position' => 2,
@@ -75,7 +75,7 @@ function create_posttype()
),
'hierarchical' => true,
'public' => true,
- 'has_archive' => true,
+ 'has_archive' => false,
'show_in_rest' => true,
'menu_icon' => 'dashicons-book',
'menu_position' => 2,
@@ -84,18 +84,19 @@ function create_posttype()
)
);
register_post_type(
- 'fiche-questions',
+ 'questions',
array(
'labels' => array(
'name' => __('Questions', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Question', 'homegrade-theme__texte-backoffice')
),
'public' => true,
- 'has_archive' => true,
- 'rewrite' => array('slug' => 'fiche-question'),
+ 'has_archive' => false,
+ // 'rewrite' => array('slug' => 'questions'),
+ // 'rewrite' => array('slug' => 'questions/%thematiques%'),
'show_in_rest' => true,
'menu_icon' => 'dashicons-editor-help',
- 'menu_position' => 4,
+ 'menu_position' => 2.1,
'supports' => array('title', 'custom-fields', 'editor', 'excerpt'),
)
);
@@ -142,7 +143,7 @@ function my_new_admin_menu_order($menu_order)
'upload.php' => 9,
// 'edit.php?post_type=page' => 1,
'edit.php?post_type=conseils' => 1,
- 'edit.php?post_type=fiche-questions' => 2,
+ 'edit.php?post_type=questions' => 2,
'edit.php?post_type=brochures' => 3,
'edit.php?post_type=vocabulaire' => 4,
);
diff --git a/includes/rooting.php b/includes/rooting.php
index a82b23b..fdeeb1c 100644
--- a/includes/rooting.php
+++ b/includes/rooting.php
@@ -11,3 +11,19 @@ function redirect_to_demo_components_page()
exit();
}
}
+
+
+// function wpa_course_post_link($post_link, $id = 0)
+// {
+// $post = get_post($id);
+// if (is_object($post) && ICL_LANGUAGE_CODE == 'fr') {
+// $terms = wp_get_object_terms($post->ID, 'thematiques');
+// if ($terms) {
+// return str_replace('%thematiques%', $terms[0]->slug, $post_link);
+// }
+// }
+
+
+// return $post_link;
+// }
+// add_filter('post_type_link', 'wpa_course_post_link', 1, 3);
diff --git a/includes/shortcuts/shortcuts.php b/includes/shortcuts/shortcuts.php
index cf65538..d0221d3 100644
--- a/includes/shortcuts/shortcuts.php
+++ b/includes/shortcuts/shortcuts.php
@@ -35,8 +35,8 @@ get_template_part(
)
);
-/** ------------------------------
- QUERIES
+/* ------------------------------
+ QUERIES
------------------------------*/
diff --git a/includes/taxonomy.php b/includes/taxonomy.php
index cc0ee22..71ab6fd 100644
--- a/includes/taxonomy.php
+++ b/includes/taxonomy.php
@@ -44,7 +44,7 @@ function undo_create_term($term_id, $tt_id, $taxonomy)
function add_custom_taxonomies()
{
// ————— Thématiques —————
- register_taxonomy('thematiques', ['fiche-questions', 'conseils', 'brochures'], array(
+ register_taxonomy('thematiques', ['questions', 'conseils', 'brochures'], array(
// 'hierarchical' => true,
'labels' => array(
'name' => __('Thématiques', 'homegrade-theme__texte-backoffice'),
@@ -67,7 +67,7 @@ function add_custom_taxonomies()
'show_in_quick_edit' => false,
'meta_box_cb' => false,
'rewrite' => array(
- 'slug' => 'nos-conseils-thematiques',
+ 'slug' => 'questions-thematiques',
// 'with_front' => false,
'hierarchical' => true,
'has_archive' => true
@@ -77,7 +77,7 @@ function add_custom_taxonomies()
// ————— mots-clés —————
- register_taxonomy('mots-cles', ['fiche-questions', 'conseils'], array(
+ register_taxonomy('mots-cles', ['questions', 'conseils'], array(
// This array of options controls the labels displayed in the WordPress Admin UI
'labels' => array(
@@ -103,6 +103,27 @@ function add_custom_taxonomies()
add_action('init', 'add_custom_taxonomies', 0);
/* ----------------------------------------------------------------------
- Add custom taxonomy terms to body class
+ HIDE THEMATIQUE METABOX
------------------------------------------------------------------------*/
+// on passe le metabox_cb à false pour ne pas afficher la metabox
+function tna_edit_taxonomy_args($args, $tax_slug, $cptui_tax_args)
+{
+ // Alternatively, you can check for specific taxonomies.
+ if ('thematiques' === $tax_slug) {
+ $args['meta_box_cb'] = false;
+ }
+ return $args;
+}
+add_filter('cptui_pre_register_taxonomy', 'tna_edit_taxonomy_args', 10, 3);
+// on récupère les élément avec un metabox_cb false et on les masque dans la sidebar
+add_filter('rest_prepare_taxonomy', function ($response, $taxonomy, $request) {
+ $context = !empty($request['context']) ? $request['context'] : 'view';
+ // Context is edit in the editor
+ if ($context === 'edit' && $taxonomy->meta_box_cb === false) {
+ $data_response = $response->get_data();
+ $data_response['visibility']['show_ui'] = false;
+ $response->set_data($data_response);
+ }
+ return $response;
+}, 10, 3);
diff --git a/includes/utilities.php b/includes/utilities.php
index 847b117..b5132a1 100644
--- a/includes/utilities.php
+++ b/includes/utilities.php
@@ -8,29 +8,35 @@ function getThematiqueFamilySlug($thematique_slug)
return "energies-urbanisme";
case "acoustique":
+ case "akoestiek":
case "petites-coproprietes":
+ case "kleine-mede-eigendommen":
return "acoustique-coproprietes";
case "isolation":
+ case "isolatie":
case "au-quotidien":
return "isolation-quotidien";
case "energies":
case "urbanisme":
+ case "stedenbouw":
return "energies-urbanisme";
case "patrimoine":
+ case "erfgoed":
case "renovation":
return "patrimoine-renovation";
case "location":
+ case "verhuur":
return "location";
}
}
function getParentThematique($thematique)
{
- if($thematique->parent == 0) {
+ if ($thematique->parent == 0) {
return $thematique;
} else {
return get_term($thematique->parent, 'thematiques');
@@ -42,10 +48,9 @@ function getParentThematique($thematique)
function get_automatic_post($post_type)
{
$automatic_query_args = array(
- 'numberposts' => 2,
'post_per_page' => 1,
'post_status' => 'publish',
- 'post_type' => 'fiche-questions',
+ 'post_type' => 'questions',
'thematiques' => $post_type,
);
return get_posts($automatic_query_args)[0];
diff --git a/resources/css/admin-style.css b/resources/css/admin-style.css
index e18e9f1..7069bf5 100644
--- a/resources/css/admin-style.css
+++ b/resources/css/admin-style.css
@@ -10,3 +10,77 @@
#toplevel_page_theme-general-settings {
border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
}
+
+/* .wp-block-post-content,
+.is-root-container {
+ background-color: red !imporatant;
+}
+
+.block-editor-block-list__block {
+ background-color: yellow !imporatant; */
+/* } */
+
+body.acoustique-coproprietes {
+ h2,
+ h3 {
+ @apply text-acoustique-coproprietes;
+ }
+ ul li::marker {
+ @apply text-acoustique-coproprietes;
+ }
+ .homegrade-blocks-highlight {
+ @apply bg-acoustique-coproprietes-light;
+ }
+}
+body.energies-urbanisme {
+ h2,
+ h3 {
+ @apply text-energies-urbanisme;
+ }
+ ul li::marker {
+ @apply text-energies-urbanisme;
+ }
+ .homegrade-blocks-highlight {
+ @apply bg-energies-urbanisme-light;
+ }
+}
+body.isolation-quotidien {
+ h2,
+ h3 {
+ @apply text-isolation-quotidien;
+ }
+ ul li::before {
+ @apply bg-isolation-quotidien;
+ }
+ ul li::marker {
+ @apply text-isolation-quotidien;
+ }
+ .homegrade-blocks-highlight {
+ @apply bg-isolation-quotidien-light;
+ }
+}
+body.patrimoine-renovation {
+ h1,
+ h2,
+ h3 {
+ @apply text-patrimoine-renovation;
+ }
+ ul li::marker {
+ @apply text-patrimoine-renovation;
+ }
+ .homegrade-blocks-highlight {
+ @apply bg-patrimoine-renovation-light;
+ }
+}
+body.location {
+ h2,
+ h3 {
+ @apply text-location;
+ }
+ ul li::marker {
+ @apply text-location;
+ }
+ .homegrade-blocks-highlight {
+ @apply bg-location-light;
+ }
+}
diff --git a/resources/css/app.css b/resources/css/app.css
index dd76041..5147f49 100644
--- a/resources/css/app.css
+++ b/resources/css/app.css
@@ -5,6 +5,7 @@
/* ########### UTILITIES ############ */
@import './utilities/shadows.css';
@import './utilities/animation.css';
+@import './utilities/rounding-radius.css';
/* ########### BASE ############ */
@import './base/typography.css';
@@ -17,6 +18,10 @@
@import './components/card-large-content.css';
@import './components/section-titling.css';
@import './components/search-module.css';
+@import './components/thematiques-post-viewer.css';
+@import './components/breadcrumb.css';
+@import './components/archive-page-header.css';
+@import './components/brochures-grid.css';
@import '../../template-components/card-news.css';
@import '../../template-components/card-frequent_question.css';
@@ -44,6 +49,10 @@
@import './blocks/chapter-header-block.css';
@import './blocks/questions-container-block.css';
@import './blocks/points-cles.css';
+@import './blocks/highlight.css';
/* ########### PAGE ############ */
@import './pages/demo-components.css';
+@import './pages/template-archive-brochures.css';
+@import './pages/template-archive-conseils.css';
+@import './pages/template-archive-questions.css';
diff --git a/resources/css/blocks/highlight.css b/resources/css/blocks/highlight.css
new file mode 100644
index 0000000..b3439c6
--- /dev/null
+++ b/resources/css/blocks/highlight.css
@@ -0,0 +1,10 @@
+.homegrade-blocks-highlight {
+ @apply p-12 rounding-radius;
+
+ h3 {
+ @apply pb-4;
+ }
+ .icon {
+ @apply bg-primary;
+ }
+}
diff --git a/resources/css/components/archive-page-header.css b/resources/css/components/archive-page-header.css
new file mode 100644
index 0000000..01b65fd
--- /dev/null
+++ b/resources/css/components/archive-page-header.css
@@ -0,0 +1,32 @@
+.archive-page-header {
+ @apply bg-primary text-white text-center py-12 max-w-screen-xl mx-auto
+ mt-0 rounded-2xl;
+ &__title {
+ @apply uppercase font-medium text-xl tracking-widest;
+ }
+ &__description {
+ @apply font-bold text-4xl max-w-screen-md mx-auto pt-4;
+ }
+ /* POUR TEMPLATE ARCHIVE CONSEILS ET ARCHIVE QUESTIONS */
+ &__terms-grid {
+ @apply grid grid-cols-4 max-w-screen-md mx-auto gap-4 p-4 pt-8;
+
+ .term {
+ @apply bg-white rounded-3xl px-4 py-6 font-bold leading-4;
+ }
+ .term img {
+ @apply rounded-lg pb-4 max-w-[80px] mx-auto;
+ }
+ }
+ /* POUR PUBLICATIONS */
+ &__search-grid {
+ @apply grid grid-cols-4 max-w-screen-md mx-auto gap-4 p-4 pt-8;
+
+ .term {
+ @apply bg-white rounded-3xl px-4 py-6 font-bold leading-4;
+ }
+ .term img {
+ @apply rounded-lg pb-4 max-w-[80px] mx-auto;
+ }
+ }
+}
diff --git a/resources/css/components/breadcrumb.css b/resources/css/components/breadcrumb.css
new file mode 100644
index 0000000..474fc03
--- /dev/null
+++ b/resources/css/components/breadcrumb.css
@@ -0,0 +1,20 @@
+.breadcrumbs_navigation {
+ @apply py-6 max-w-screen-xl mx-auto;
+ ol {
+ @apply list-none flex items-center text-sm font-bold;
+
+ li + li {
+ &:before {
+ @apply ml-1 mr-2;
+ @apply inline-block;
+ content: '';
+ border-right: 2.5px solid #000;
+ border-bottom: 2.5px solid #000;
+ border-radius: 2px;
+ height: 8px;
+ width: 8px;
+ transform: rotate(-45deg);
+ }
+ }
+ }
+}
diff --git a/resources/css/components/brochures-grid.css b/resources/css/components/brochures-grid.css
new file mode 100644
index 0000000..68b6c41
--- /dev/null
+++ b/resources/css/components/brochures-grid.css
@@ -0,0 +1,26 @@
+.brochures-grid {
+ @apply max-w-screen-xl mx-auto py-12 mb-12;
+
+ &__row {
+ @apply grid grid-cols-11 gap-8;
+ align-items: center;
+ }
+ &__row + &__row {
+ @apply mt-8 border-t border-gray pt-8;
+ }
+ &__cover {
+ @apply w-20 rounded-lg col-span-1;
+ }
+ &__title {
+ @apply col-span-4 font-bold;
+ }
+ &__thematique {
+ @apply col-span-2 text-center;
+ }
+ &__edition {
+ @apply col-span-2 text-center;
+ }
+ &__button {
+ @apply col-span-2 flex justify-end;
+ }
+}
diff --git a/resources/css/components/card-large-content.css b/resources/css/components/card-large-content.css
index 018adcf..82d068f 100644
--- a/resources/css/components/card-large-content.css
+++ b/resources/css/components/card-large-content.css
@@ -5,7 +5,7 @@
}
}
.card-large-content {
- @apply bg-white max-w-screen-2xl w-full rounded-3xl p-16 relative;
+ @apply bg-white max-w-screen-xl w-full rounded-3xl p-16 relative;
&--has-illustration {
@apply pt-40;
}
diff --git a/resources/css/components/search-module.css b/resources/css/components/search-module.css
index 4614365..dbd2a6c 100644
--- a/resources/css/components/search-module.css
+++ b/resources/css/components/search-module.css
@@ -40,6 +40,7 @@
height: 1px;
}
&__input {
+ box-sizing: border-box;
@apply block max-w-full flex-grow py-3 border border-black rounded-tl-3xl rounded-bl-3xl px-4;
}
button[type='submit'] {
diff --git a/resources/css/components/section-titling.css b/resources/css/components/section-titling.css
index f3cad24..37adcb7 100644
--- a/resources/css/components/section-titling.css
+++ b/resources/css/components/section-titling.css
@@ -1,5 +1,8 @@
.section_titling {
@apply text-center pb-8;
+ &--left {
+ @apply text-left;
+ }
&__title {
@apply text-secondary
@@ -9,10 +12,14 @@
pb-2
tracking-widest;
}
+ &.section_titling--left {
+ @apply bg-yellow-400;
+ }
&__subtitle {
@apply text-black
font-bold
- max-w-3xl mx-auto
+ max-w-3xl
+ mx-auto
text-4xl;
}
diff --git a/resources/css/components/thematiques-post-viewer.css b/resources/css/components/thematiques-post-viewer.css
new file mode 100644
index 0000000..11002b1
--- /dev/null
+++ b/resources/css/components/thematiques-post-viewer.css
@@ -0,0 +1,19 @@
+.thematiques-post-viewer {
+ @apply bg-primary text-white text-center py-12 max-w-screen-xl mx-auto mt-0;
+ &__title {
+ @apply uppercase font-medium text-xl tracking-widest;
+ }
+ &__description {
+ @apply font-bold text-4xl max-w-screen-md mx-auto pt-4;
+ }
+ &__terms-grid {
+ @apply grid grid-cols-4 max-w-screen-md mx-auto gap-4 p-4 pt-8;
+
+ .term {
+ @apply bg-white rounded-3xl px-4 py-6 font-bold leading-4;
+ }
+ .term img {
+ @apply rounded-lg pb-4 max-w-[80px] mx-auto;
+ }
+ }
+}
diff --git a/resources/css/layout/footer.css b/resources/css/layout/footer.css
index 36c90d2..6f7dc2e 100644
--- a/resources/css/layout/footer.css
+++ b/resources/css/layout/footer.css
@@ -1,5 +1,5 @@
.site-footer {
- @apply bg-gray grid grid-cols-4 px-8 gap-8 mt-12;
+ @apply bg-gray grid grid-cols-4 px-8 gap-8;
&__informative-message {
@apply bg-primary text-white p-8 col-span-4 rounded-3xl flex justify-center;
diff --git a/resources/css/layout/gutenberg.css b/resources/css/layout/gutenberg.css
index 1a86f3a..f4cc902 100644
--- a/resources/css/layout/gutenberg.css
+++ b/resources/css/layout/gutenberg.css
@@ -3,8 +3,68 @@ article > *:not(.entry-content, .chapter-header-block),
@apply mx-auto max-w-content;
}
-.entry-content,
-.block-editor-block-list__layout {
+.entry-content {
+ &--acoustique-coproprietes {
+ h2,
+ h3 {
+ @apply text-acoustique-coproprietes;
+ }
+ ul li::marker {
+ @apply text-acoustique-coproprietes;
+ }
+ .homegrade-blocks-highlight {
+ @apply bg-acoustique-coproprietes-light;
+ }
+ }
+ &--energies-urbanisme {
+ h2,
+ h3 {
+ @apply text-energies-urbanisme;
+ }
+ ul li::marker {
+ @apply text-energies-urbanisme;
+ }
+ .homegrade-blocks-highlight {
+ @apply bg-energies-urbanisme-light;
+ }
+ }
+ &--isolation-quotidien {
+ h2,
+ h3 {
+ @apply text-isolation-quotidien;
+ }
+ ul li::marker {
+ @apply text-isolation-quotidien;
+ }
+ .homegrade-blocks-highlight {
+ @apply bg-isolation-quotidien-light;
+ }
+ }
+ &--patrimoine-renovation {
+ h1,
+ h2,
+ h3 {
+ @apply text-patrimoine-renovation;
+ }
+ ul li::marker {
+ @apply text-patrimoine-renovation;
+ }
+ .homegrade-blocks-highlight {
+ @apply bg-patrimoine-renovation-light;
+ }
+ }
+ &--location {
+ h2,
+ h3 {
+ @apply text-location;
+ }
+ ul li::marker {
+ @apply text-location;
+ }
+ .homegrade-blocks-highlight {
+ @apply bg-location-light;
+ }
+ }
h1 {
@apply text-2xl;
}
@@ -14,14 +74,19 @@ article > *:not(.entry-content, .chapter-header-block),
}
h3 {
- @apply text-lg;
+ @apply font-bold text-2xl;
}
p,
ul,
ol {
a {
- @apply text-blue-500 underline;
+ @apply text-primary font-bold underline underline-offset-4;
+ /* &:after {
+ @apply inline-block bg-red-500 h-3 w-3 ml-2;
+ content: '';
+ background-image: url('/wp-content/themes/homegrade/dist/images/arrow.svg');
+ } */
&:hover {
@apply no-underline;
@@ -43,55 +108,3 @@ article > *:not(.entry-content, .chapter-header-block),
}
}
}
-
-.single-editor-content {
- h3 {
- @apply font-bold text-2xl;
- }
- &--acoustique-coproprietes {
- h2,
- h3 {
- @apply text-acoustique-coproprietes;
- }
- ul li::marker {
- @apply text-acoustique-coproprietes;
- }
- }
- &--energies-urbanisme {
- h2,
- h3 {
- @apply text-energies-urbanisme;
- }
- ul li::marker {
- @apply text-energies-urbanisme;
- }
- }
- &--isolation-quotidien {
- h2,
- h3 {
- @apply text-isolation-quotidien;
- }
- ul li::marker {
- @apply text-isolation-quotidien;
- }
- }
- &--patrimoine-renovation {
- h1,
- h2,
- h3 {
- @apply text-patrimoine-renovation;
- }
- ul li::marker {
- @apply text-patrimoine-renovation;
- }
- }
- &--location {
- h2,
- h3 {
- @apply text-location;
- }
- ul li::marker {
- @apply text-location;
- }
- }
-}
diff --git a/resources/css/pages/template-archive-brochures.css b/resources/css/pages/template-archive-brochures.css
new file mode 100644
index 0000000..7966846
--- /dev/null
+++ b/resources/css/pages/template-archive-brochures.css
@@ -0,0 +1,6 @@
+.archives-publications-header {
+ @apply bg-primary max-w-screen-xl text-white text-center mx-auto;
+}
+.brochures-archives {
+ @apply max-w-screen-xl mx-auto py-4;
+}
diff --git a/resources/css/pages/template-archive-conseils.css b/resources/css/pages/template-archive-conseils.css
new file mode 100644
index 0000000..e69de29
diff --git a/resources/css/pages/template-archive-questions.css b/resources/css/pages/template-archive-questions.css
new file mode 100644
index 0000000..b57e2b2
--- /dev/null
+++ b/resources/css/pages/template-archive-questions.css
@@ -0,0 +1,9 @@
+.card-large-content-container {
+ @apply pt-40 mt-12 mb-0;
+
+ .card-large-content {
+ &__links-container {
+ @apply lg:gap-32;
+ }
+ }
+}
diff --git a/resources/css/utilities/rounding-radius.css b/resources/css/utilities/rounding-radius.css
new file mode 100644
index 0000000..08aa7ae
--- /dev/null
+++ b/resources/css/utilities/rounding-radius.css
@@ -0,0 +1,3 @@
+.rounding-radius {
+ border-radius: 22px;
+}
diff --git a/resources/img/illustrations/illustration-homegrade-help.svg b/resources/img/illustrations/illustration-homegrade-help.svg
new file mode 100644
index 0000000..a22300a
--- /dev/null
+++ b/resources/img/illustrations/illustration-homegrade-help.svg
@@ -0,0 +1,72 @@
+
diff --git a/resources/img/pictogrammes/pictogramme-conseils.svg b/resources/img/pictogrammes/pictogramme-conseils.svg
new file mode 100644
index 0000000..db073c1
--- /dev/null
+++ b/resources/img/pictogrammes/pictogramme-conseils.svg
@@ -0,0 +1,26 @@
+
diff --git a/searchform-custom-1.php b/searchform-custom-1.php
new file mode 100644
index 0000000..0a62915
--- /dev/null
+++ b/searchform-custom-1.php
@@ -0,0 +1,14 @@
+
\ No newline at end of file
diff --git a/single.php b/single.php
index b41217a..4f243fa 100644
--- a/single.php
+++ b/single.php
@@ -11,12 +11,12 @@ get_header();
$thematiqueParent = getParentThematique($thematique);
$thematiqueColorSlug = getThematiqueFamilySlug($thematiqueParent->slug);
?>
-