refining anysurfer

This commit is contained in:
Antoine M 2023-08-03 10:31:09 +02:00
parent 12b0baf4e1
commit eb9cf5e52e
26 changed files with 362 additions and 82 deletions

View File

@ -1976,6 +1976,10 @@ header#main-header {
}
}
.site-footer__partenaires a img {
display: inline-block;
}
.site-footer__metiers-patrimoine {
grid-column: span 4 / span 4;
}
@ -1986,7 +1990,7 @@ header#main-header {
}
}
article > *:not(.entry-content),
article > *:not(.entry-content, .chapter-header-block),
.entry-content > * {
margin-left: auto;
margin-right: auto;
@ -2038,6 +2042,68 @@ article > *:not(.entry-content),
list-style-type: decimal;
}
.single-editor-content h3 {
font-size: 1.5rem;
line-height: 2rem;
font-weight: 700;
}
.single-editor-content--acoustique-coproprietes h2,
.single-editor-content--acoustique-coproprietes h3 {
--tw-text-opacity: 1;
color: rgb(36 94 242 / var(--tw-text-opacity));
}
.single-editor-content--acoustique-coproprietes ul li::marker {
--tw-text-opacity: 1;
color: rgb(36 94 242 / var(--tw-text-opacity));
}
.single-editor-content--energies-urbanisme h2,
.single-editor-content--energies-urbanisme h3 {
--tw-text-opacity: 1;
color: rgb(2 126 80 / var(--tw-text-opacity));
}
.single-editor-content--energies-urbanisme ul li::marker {
--tw-text-opacity: 1;
color: rgb(2 126 80 / var(--tw-text-opacity));
}
.single-editor-content--isolation-quotidien h2,
.single-editor-content--isolation-quotidien h3 {
--tw-text-opacity: 1;
color: rgb(194 69 3 / var(--tw-text-opacity));
}
.single-editor-content--isolation-quotidien ul li::marker {
--tw-text-opacity: 1;
color: rgb(194 69 3 / var(--tw-text-opacity));
}
.single-editor-content--patrimoine-renovation h1,
.single-editor-content--patrimoine-renovation h2,
.single-editor-content--patrimoine-renovation h3 {
--tw-text-opacity: 1;
color: rgb(139 47 247 / var(--tw-text-opacity));
}
.single-editor-content--patrimoine-renovation ul li::marker {
--tw-text-opacity: 1;
color: rgb(139 47 247 / var(--tw-text-opacity));
}
.single-editor-content--location h2,
.single-editor-content--location h3 {
--tw-text-opacity: 1;
color: rgb(223 0 43 / var(--tw-text-opacity));
}
.single-editor-content--location ul li::marker {
--tw-text-opacity: 1;
color: rgb(223 0 43 / var(--tw-text-opacity));
}
.menu-renovateur {
position: relative;
display: flex;
@ -2744,14 +2810,6 @@ article > *:not(.entry-content),
color: rgb(223 30 30 / var(--tw-text-opacity));
}
.menu-homegrade--footer > li.menu-item {
order: 5;
}
.menu-homegrade--footer > li.menu-item-has-children {
order: 1;
}
.menu-homegrade--footer > li.menu-item > a,
.menu-homegrade--footer h6.page-group-title {
margin-bottom: 0.5rem;
@ -3252,6 +3310,75 @@ article > *:not(.entry-content),
}
}
/* ########### ADD STYLE LAYER TO CONTENT BLOCKS (FROM PLUGIN) ############ */
.chapter-header-block {
padding: 2rem;
}
@media (min-width: 782px) {
.chapter-header-block {
padding-left: 4rem;
padding-right: 4rem;
}
}
.chapter-header-block__page-thematic-title {
padding-bottom: 1rem;
font-size: 1.25rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.chapter-header-block__page-title {
font-size: 2.25rem;
line-height: 2.5rem;
font-weight: 700;
}
.chapter-header-block__infos {
max-width: 42rem;
}
.chapter-header-block__infos .cta {
margin-top: 2rem;
margin-bottom: 2rem;
}
.questions-container-block h2 {
font-size: 2.25rem;
line-height: 2.5rem;
font-weight: 700;
--tw-text-opacity: 1;
color: rgb(0 0 0 / var(--tw-text-opacity));
}
.wp-block-homegrade-content-blocks-points-cles {
border-radius: 1.5rem;
--tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
padding: 2rem;
--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.wp-block-homegrade-content-blocks-points-cles__titling {
margin-bottom: 1.5rem;
}
.wp-block-homegrade-content-blocks-points-cles__titling .icon {
--tw-bg-opacity: 1;
background-color: rgb(47 1 84 / var(--tw-bg-opacity));
}
.wp-block-homegrade-content-blocks-points-cles h3 {
font-size: 1.5rem;
line-height: 2rem;
font-weight: 700;
}
/* ########### PAGE ############ */
.demo-components .title {

View File

@ -421,11 +421,11 @@ body {
max-width: 1280px
}
.wp-block[data-align="wide"] {
.wp-block[data-align='wide'] {
max-width: 1280px
}
.wp-block[data-align="full"] {
.wp-block[data-align='full'] {
max-width: 100%
}
@ -443,6 +443,11 @@ body {
max-width: 782px
}
.block-editor-default-block-appender .block-editor-inserter button {
--tw-bg-opacity: 1 !important;
background-color: rgb(223 30 30 / var(--tw-bg-opacity)) !important
}
.hover\:bg-primary:hover {
--tw-bg-opacity: 1;
background-color: rgb(47 1 84 / var(--tw-bg-opacity))

View File

@ -7,9 +7,10 @@
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
<?php wp_head(); ?>
</head>
<body>
<body <?php body_class(); ?>>
<?php
do_action('tailpress_site_before');
global $post;

View File

@ -6,13 +6,13 @@ function client_add_block_categories($categories)
{
return array_merge(
[
[
'slug' => 'homegrade-blocks',
'title' => 'Homegrade Generic Blocks ',
'icon' => 'heart',
],
],
// [
// [
// 'slug' => 'homegrade-blocks',
// 'title' => 'Homegrade Generic Blocks ',
// 'icon' => 'heart',
// ],
// ],
$categories,
[
[

View File

@ -29,7 +29,7 @@ function tailpress_setup()
'caption',
)
);
// add_theme_support('title-tag');
add_theme_support('title-tag');
add_theme_support('custom-logo');
add_theme_support('post-thumbnails');

View File

@ -8,7 +8,7 @@ function homegrade_brochure_post_title_updater($post_id)
$brochureTaxonomy = get_the_terms($post_id, 'thematiques')[0];
write_log($brochureTaxonomy);
// write_log($brochureTaxonomy);
if (get_post_type() == 'brochures') {

View File

@ -51,6 +51,10 @@ function create_posttype()
'name' => __('Conseils', 'homegrade-theme__texte-backoffice'),
'singular_name' => __('Conseil', 'homegrade-theme__texte-backoffice')
),
'template' => [
array('homegrade-content-blocks/chapter-header'),
array('core/paragraph', ['placeholder' => 'Add truc Description…',]),
],
'hierarchical' => true,
'public' => true,
'has_archive' => true,

View File

@ -11,6 +11,8 @@ define('WP_DEBUG_DISPLAY', false);
<?php if ($var) : ?>
<p><?php echo $var['title'] ?></p>
<?php else : ?>
<p>Alternative content when $var is falsy or null</p>
<?php endif; ?>
@ -37,6 +39,7 @@ get_template_part(
QUERIES
------------------------------*/
// ##### Query 🡒 Get posts
$args = array(

View File

@ -1,6 +1,8 @@
<?php
// ########## HIDE DEFAULT TAXONOMIES
/* ----------------------------------------------------------------------
HIDE DEFAULT TAXONOMIES
------------------------------------------------------------------------*/
function wpsnipp_remove_default_taxonomies()
{
global $pagenow;
@ -19,8 +21,10 @@ add_action('init', 'wpsnipp_remove_default_taxonomies');
// ########## OTHER THAN ADMIN CANNOT CREATE TAGS
/* ----------------------------------------------------------------------
OTHER THAN ADMIN CANNOT CREATE TAGS
------------------------------------------------------------------------*/
add_action('create_term', 'undo_create_term', 10, 3);
function undo_create_term($term_id, $tt_id, $taxonomy)
@ -33,9 +37,9 @@ function undo_create_term($term_id, $tt_id, $taxonomy)
}
// ########## REGISTER TAXONOMY
/* ----------------------------------------------------------------------
REGISTER TAXONOMIES
------------------------------------------------------------------------*/
function add_custom_taxonomies()
{
@ -72,7 +76,7 @@ function add_custom_taxonomies()
));
// ————— —————
// ————— mots-clés —————
register_taxonomy('mots-cles', ['fiche-questions', 'conseils'], array(
// This array of options controls the labels displayed in the WordPress Admin UI
@ -97,3 +101,8 @@ function add_custom_taxonomies()
));
}
add_action('init', 'add_custom_taxonomies', 0);
/* ----------------------------------------------------------------------
Add custom taxonomy terms to body class
------------------------------------------------------------------------*/

View File

@ -28,6 +28,14 @@ function getThematiqueFamilySlug($thematique_slug)
}
}
function getParentThematique($thematique)
{
if($thematique->parent == 0) {
return $thematique;
} else {
return get_term($thematique->parent, 'thematiques');
}
}
// Get automatic post used in BLOCK QUESTIONS FREQUENTES

View File

@ -2,6 +2,8 @@
// resources/js/header.js
function menuInit() {
const header = document.querySelector("#main-header");
if (!header)
return;
const searchModule = header.querySelector(".search-module");
const searchModuleToggle = header.querySelector("#search-module-toggle");
const mobileMenuToggle = header.querySelector("#mobile-menu-toggle");

View File

@ -40,5 +40,10 @@
@import '../../template-blocks/home/demarches-administratives/demarches-administratives.css';
@import '../../template-blocks/home/questions-frequentes/questions-frequentes.css';
/* ########### ADD STYLE LAYER TO CONTENT BLOCKS (FROM PLUGIN) ############ */
@import './blocks/chapter-header-block.css';
@import './blocks/questions-container-block.css';
@import './blocks/points-cles.css';
/* ########### PAGE ############ */
@import './pages/demo-components.css';

View File

@ -0,0 +1,16 @@
.chapter-header-block {
@apply p-8 md:px-16;
&__page-thematic-title {
@apply text-xl uppercase font-bold tracking-wider pb-4;
}
&__page-title {
@apply text-4xl font-bold;
}
&__infos {
@apply max-w-2xl;
.cta {
@apply my-8;
}
}
}

View File

@ -0,0 +1,14 @@
.wp-block-homegrade-content-blocks-points-cles {
@apply p-8 shadow-lg bg-white rounded-3xl;
&__titling {
@apply mb-6;
.icon {
@apply bg-primary;
}
}
h3 {
@apply font-bold text-2xl;
}
}

View File

@ -0,0 +1,5 @@
.questions-container-block {
h2 {
@apply font-bold text-black text-4xl;
}
}

View File

@ -1,5 +1,5 @@
@import "tailwindcss/components";
@import "tailwindcss/utilities";
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
body {
@apply font-sans;
@ -9,11 +9,11 @@ body {
@apply max-w-screen-xl;
}
.wp-block[data-align="wide"] {
.wp-block[data-align='wide'] {
@apply max-w-screen-xl;
}
.wp-block[data-align="full"] {
.wp-block[data-align='full'] {
@apply max-w-full;
}
.wp-block.alignfull {
@ -26,3 +26,9 @@ body {
.acf-block-fields {
@apply max-w-screen-md mx-auto;
}
.block-editor-default-block-appender .block-editor-inserter {
button {
@apply !bg-secondary;
}
}

View File

@ -40,6 +40,9 @@
}
&__partenaires {
@apply flex flex-wrap col-span-4 md:col-span-2 justify-center items-center gap-12;
a img {
@apply inline-block;
}
}
&__metiers-patrimoine {

View File

@ -1,4 +1,4 @@
article > *:not(.entry-content),
article > *:not(.entry-content, .chapter-header-block),
.entry-content > * {
@apply mx-auto max-w-content;
}
@ -43,3 +43,55 @@ article > *:not(.entry-content),
}
}
}
.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;
}
}
}

View File

@ -245,12 +245,6 @@
li.menu-item a {
@apply hover:text-secondary;
}
> li.menu-item {
order: 5;
}
> li.menu-item-has-children {
order: 1;
}
> li.menu-item > a,
h6.page-group-title {

View File

@ -1,5 +1,6 @@
export default function menuInit() {
const header = document.querySelector('#main-header');
if (!header) return;
// Search module
const searchModule = header.querySelector('.search-module');

View File

@ -1,27 +1,22 @@
<?php get_header(); ?>
<?php
get_header();
?>
<div class="container my-8 mx-auto">
<?php if (have_posts()) : ?>
<?php
while (have_posts()) :
the_post();
the_content()
$thematique = get_the_terms(get_the_ID(), 'thematiques')[0];
$thematiqueParent = getParentThematique($thematique);
$thematiqueColorSlug = getThematiqueFamilySlug($thematiqueParent->slug);
?>
<?php
// If comments are open or we have at least one comment, load up the comment template.
// if ( comments_open() || get_comments_number() ) :
// comments_template();
// endif;
?>
<article class="container my-8 mx-auto single-editor-content <?php echo $thematiqueColorSlug ? "single-editor-content--" . $thematiqueColorSlug : "" ?>">
<?php the_content() ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
</article>
<?php
get_footer();

View File

@ -1,10 +1,12 @@
<?php get_header();
$term = get_queried_object();
echo '<pre>';
print_r($term);
print_r(is_tax('thematiques', 'thematiques'));
echo '</pre>';
// $term = get_queried_object();
// $term_test = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
$current_general_thematique = get_queried_object()->parent ? get_term(get_queried_object()->parent, 'thematiques') : get_term(get_queried_object(), 'thematiques');
$current_children_thematique = get_queried_object()->parent != 0 ? get_queried_object() : null;
$args = array(
'posts_per_page' => 1,
@ -14,14 +16,26 @@ $args = array(
'slug' => 'locations',
'taxonomy' => 'thematiques',
'field' => 'slug',
'terms' => $term->slug,
'include_children' => false,
'terms' => get_queried_object()->slug,
// 'include_children' => false,
)
)
);
$query_thematique_posts = new WP_Query($args);
$thematique_related_page = $query_thematique_posts->posts[0];
$query_current_thematique_posts = new WP_Query($args);
$thematique_related_page = $query_current_thematique_posts->posts[0];
echo '<pre>';
// print_r($term);
// print_r($term_test);
// print_r($query_current_thematique_posts->posts);
// print_r($thematique_related_page);
// print_r($current_children_thematique);
// print_r($current_thematique);
// print_r(is_tax('thematiques', 'thematiques'));
echo '</pre>';
$test = get_term_by('id', 12, 'category');
if ($term->parent == 0) {
@ -42,7 +56,24 @@ if ($term->parent == 0) {
// echo $the_query->posts[0]->post_content;
?>
<div class="breadcrumb-thematiques">
<ul>
<li>
<a href="">Home ></a>
</li>
<li>
<a href="<?php echo get_term_link($current_general_thematique) ?>"><?php echo $current_general_thematique->name ?></a>
</li>
<?php if ($current_children_thematique) : ?>
<li>
<a href="<?php echo get_term_link($current_children_thematique) ?>"><?php echo $current_children_thematique->name ?></a>
</li>
<?php endif; ?>
</ul>
</div>
<div class="container my-8 mx-auto">
<?php

View File

@ -8,10 +8,8 @@ $terms = get_terms(array(
'hide_empty' => false,
));
?>
<section class="section-show-thematiques">
<div class="section_titling">

View File

@ -13,8 +13,8 @@ $color = getThematiqueFamilySlug($thematique->slug);
<p class="card-thematique__description"><?php echo $thematique->description ?></p>
<a class="card-thematique__cta hover:text-<?php echo getThematiqueFamilySlug($thematique->slug) ?>" href="<?php echo get_term_link($thematique) ?> ">
En savoir plus
<span class="sr-only">sur <?php echo $thematique->slug ?></span>
<?php echo __("En savoir plus ", "homegrade-theme__texte-fonctionnel") ?>
<span class="sr-only"><?php echo __("sur ", "homegrade-theme__texte-fonctionnel") ?><?php echo $thematique->slug ?></span>
<div class="cta_arrow_button">
<img src='<?php echo get_template_directory_uri() ?>/resources/img/graphic-assets/arrow-right-circle.svg' alt=''>
</div>

View File

@ -17,7 +17,7 @@ $logoSRC = wp_get_attachment_image_src($logoID, 'full');
<div class="website_logo">
<?php if (has_custom_logo()) { ?>
<a id="website-logo-link" href="<?php echo home_url() ?>" tabindex="0">
<img src="<?php echo $logoSRC[0] ?>" alt="alt=" <?php echo __("Accueil Homegrade.brussels", "homegrade-theme__texte-fonctionnel") ?>" ">
<img src="<?php echo $logoSRC[0] ?>" alt="<?php echo __("Accueil Homegrade.brussels", "homegrade-theme__texte-fonctionnel") ?>">
</a>
<!-- <?php the_custom_logo(); ?> -->
<?php } else { ?>
@ -42,7 +42,8 @@ $logoSRC = wp_get_attachment_image_src($logoID, 'full');
// write_log($item);
$link = $item->url;
$title = $item->title;
$pageIcon = get_field('page_icon', $object->ID);
// $pageIcon = get_field('page_icon', $item->ID);
// echo '<pre>';
// print_r($item);
// print_r($pageIcon);

View File

@ -5,7 +5,7 @@
<div class="search-module__wrapper-container">
<?php get_search_form(); ?>
<div class="search-module__suggestions">
<h6>Suggestions :</h6>
<p>Suggestions :</p>
<?php
$args = array(
'post_type' => 'conseils',