Compare commits

..

12 Commits

Author SHA1 Message Date
Antoine M
ee3797a14d REMOVE old unused blocks code
Some checks failed
continuous-integration/drone/push Build is failing
2025-06-26 17:39:25 +02:00
Antoine M
0d69ec18d7 UPLOAD Asset 2025-06-26 17:39:08 +02:00
Antoine M
eb11cb88b4 UPLOAD Asset 2025-06-26 17:39:04 +02:00
Antoine M
be4ae54eda UPLOAD Asset 2025-06-26 17:39:01 +02:00
Antoine M
72ea8a62ba FEATURE Handling tool-container 2025-06-26 17:38:50 +02:00
Antoine M
c9eb632dd2 FIX Refining the aspect of the h1 hé etc on editor 2025-06-26 17:38:31 +02:00
Antoine M
28d67b05fb FEATURE Handling target blank 2025-06-26 17:38:05 +02:00
Antoine M
05c05cabf8 FEATURE Handling filter-white 2025-06-26 17:37:53 +02:00
Antoine M
28addcf50f FEATURE handling links style 2025-06-26 17:37:44 +02:00
Antoine M
f51a12bb53 REFACTOR Passing the post type declaration into mu-plugins 2025-06-26 17:37:33 +02:00
Antoine M
5bcb9f1175 DELETE Removing old acf blocks code directly in theme 2025-06-26 17:37:09 +02:00
Antoine M
0193ea96f7 DELETE Removing old acf blocks code directly in theme 2025-06-26 17:37:02 +02:00
15 changed files with 101 additions and 280 deletions

View File

@ -2,7 +2,6 @@
require_once(__DIR__ . '/includes/errorlog.php');
require_once(__DIR__ . '/includes/init.php');
require_once(__DIR__ . '/includes/blocks.php');
require_once(__DIR__ . '/includes/post_types.php');
require_once(__DIR__ . '/includes/admin.php');
require_once(__DIR__ . '/includes/logos.php');

View File

@ -1,101 +0,0 @@
<?php
// ##### Blocks Category 🡒 Déclaration de la catégorie de blocks custom
function client_add_block_categories($categories)
{
return array_merge(
[
[
'slug' => 'client-blocks',
'title' => 'Client Generic Blocks ',
'icon' => 'heart',
],
[
'slug' => 'client-pages',
'title' => 'Client Specific Page Blocks ',
'icon' => 'admin-page',
],
],
$categories
);
}
add_action('block_categories_all', 'client_add_block_categories', 10, 2);
// ##### Blocks 🡒 Déclaration des blocks acf custom
function acf_custom_client_blocks_init()
{
if (function_exists('acf_register_block_type')) {
// // ##### Home 🡒 Hero Section
// acf_register_block_type(array(
// 'name' => 'home_header',
// 'title' => __("Home — Section d'accueil"),
// 'description' => __("Brique pour la section d'acccueil"),
// 'render_template' => 'template-blocks/home/home_header/home_header.php',
// 'category' => 'client-blocks',
// 'multiple' => false,
// 'mode' => 'auto',
// 'align' => 'full',
// 'icon' => 'schedule',
// 'supports' => array(
// 'multiple' => false,
// 'align' => ['full'],
// 'jsx' => true
// ),
// // 'enqueue_style' => get_template_directory_uri() . '/template-parts/blocks/testimonial/testimonial.css',
// // 'enqueue_script' => get_template_directory_uri() . '/template-parts/blocks/testimonial/testimonial.js',
// // 'enqueue_assets' => function(){
// // wp_enqueue_script( 'latest_articles_js', get_stylesheet_directory_uri() . '/template-parts/blocks/home/latest_articles/latest_articles.js');
// // },
// ));
// ##### Home 🡒 Latest Articles
acf_register_block_type(array(
'name' => 'latest_articles',
'title' => __("Derniers Articles"),
'description' => __("Brique pour afficher les derniers articles publiés sur le site"),
'render_template' => 'template-blocks/generics/latest-post-query.php',
'category' => 'client-blocks',
'multiple' => false,
'mode' => 'auto',
'align' => 'wide',
'icon' => 'schedule',
// 'enqueue_style' => get_template_directory_uri() . '/template-parts/blocks/testimonial/testimonial.css',
// 'enqueue_script' => get_template_directory_uri() . '/template-parts/blocks/testimonial/testimonial.js',
// 'enqueue_assets' => function(){
// wp_enqueue_script( 'latest_articles_js', get_stylesheet_directory_uri() . '/template-parts/blocks/home/latest_articles/latest_articles.js');
// },
));
}
}
add_action('acf/init', 'acf_custom_client_blocks_init');
function mywp_register_acf_blocks()
{
// Check availability of block editor
if (!function_exists('register_block_type')) {
return;
}
register_block_type(get_template_directory() . '/template-blocks/home/home-header');
}
add_action('init', 'mywp_register_acf_blocks');
// ##### Blocks style 🡒 Re-enqueue d'un style dans l'éditeur
// function block_newsfeed_add_editor_styles() {
// add_editor_style( get_stylesheet_directory_uri() . '/template-parts/blocks/editor.css' );
// }
// add_action( 'admin_init', 'block_newsfeed_add_editor_styles' );

View File

@ -1,73 +1 @@
<?php
/* ------------------------------------------------
##### POST TYPES
--------------------------------------------------*/
function carhop_create_posttype()
{
register_post_type(
'publications',
// CPT Options
array(
'labels' => array(
'name' => __('Publications'),
'singular_name' => __('Publication')
),
'public' => true,
'has_archive' => true,
'show_in_rest' => true,
'menu_icon' => 'dashicons-analytics',
'menu_position' => 4,
'supports' => array('title', 'custom-fields'),
)
);
register_post_type(
'dbmob',
// CPT Options
array(
'labels' => array(
'name' => __('DBMOB'),
'singular_name' => __('DBMOB')
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'dictionnaire'),
'show_in_rest' => true,
'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode('<svg width="96" height="74" viewBox="0 0 96 74" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M86.4 2.2C81.6 0.7 76.3 0 71.3 0C62.9 0 53.8 1.7 47.5 6.5C41.2 1.7 32.2 0 23.8 0C15.4 0 6.3 1.7 0 6.5V69.8C0 70.9 1.1 72 2.2 72C3.3 72 2.8 71.8 3.3 71.8C9.1 69 17.6 67 23.8 67C30 67 41.3 68.7 47.6 73.5C53.4 69.8 64 67 71.4 67C78.8 67 85.9 68.3 91.9 71.5C92.3 71.7 92.5 71.7 93 71.7C94.1 71.7 95.2 70.6 95.2 69.5V6.5C92.6 4.6 89.8 3.3 86.6 2.2H86.4ZM86.4 60.5C81.6 59 76.5 58.3 71.3 58.3C64 58.3 53.4 61.1 47.5 64.8V15.1C53.3 11.4 63.9 8.6 71.3 8.6C78.7 8.6 81.7 9.2 86.4 10.8V60.5Z" fill="black"/></svg>'),
'menu_position' => 5,
'supports' => array('title', 'custom-fields'),
'taxonomies' => array('category'),
)
);
}
add_action('init', 'carhop_create_posttype');
/* ------------------------------------------------
##### CHANGE LE NOM DES POSTS PAR ACTUALITES
--------------------------------------------------*/
function carhop_change_post_object()
{
$get_post_type = get_post_type_object('post');
$labels = $get_post_type->labels;
$labels->name = 'Actualités';
$labels->singular_name = 'Actualité';
$labels->add_new = 'Ajouter une actualité';
$labels->add_new_item = 'Ajouter une nouvelle actualité';
$labels->edit_item = 'Editer l\'actualité';
$labels->new_item = 'Actualité';
$labels->view_item = 'Voir l\'actualité';
$labels->search_items = 'Chercher une actualité';
$labels->not_found = 'Pas d\'actualité trouvée';
$labels->not_found_in_trash = 'Pas d\'actualité trouvée dans la corbeille';
$labels->all_items = 'Toutes les actualités';
$labels->menu_name = 'Actualités';
$labels->name_admin_bar = 'Actualités';
// remove_post_type_support('post', 'editor');
unregister_taxonomy_for_object_type('category', 'post');
unregister_taxonomy_for_object_type('post_tag', 'post');
}
add_action('init', 'carhop_change_post_object');

View File

@ -8,6 +8,7 @@
@import './base/base.css';
@import './base/typography.css';
@import './base/filters.css';
@import './base/links.css';
/* @import './base/swiper.css'; */
/* ########### COMPONENTS ############ */

View File

@ -3,3 +3,6 @@
sepia(26%) saturate(1165%) hue-rotate(123deg)
brightness(93%) contrast(93%);
}
.filter-white {
filter: brightness(0) saturate(100%) invert(100%);
}

View File

@ -0,0 +1,11 @@
a[target='_blank'] {
&:after {
@apply content-[''] w-7 h-7 ml-2 inline-block;
background-image: url('../resources/img/carhop-fleche-lien-externe-full--green.svg');
transform: translateY(6px);
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
}

View File

@ -1,26 +1,26 @@
@import url('https://fonts.googleapis.com/css2?family=Fjalla+One&family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap');
body {
body .editor-visual-editor,
body:not(.wp-admin) {
font-family: 'Nunito Sans', sans-serif;
@apply text-primary text-xl;
}
/* @apply text-primary text-xl; */
@apply text-carhop-gray text-xl;
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'Fjalla One', sans-serif;
@apply text-primary;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: 'Fjalla One', sans-serif;
@apply text-primary;
}
h1 {
@apply text-6xl;
}
h1 {
@apply text-6xl;
}
h2 {
@apply text-5xl;
h2 {
@apply text-5xl;
}
}
p {
@ -28,20 +28,20 @@ p {
line-height: 1.8;
}
body.wp-admin h1:not(.editor-visual-editor h1),
/* body.wp-admin h1:not(.editor-visual-editor h1),
body.wp-admin h2:not(.editor-visual-editor h2),
body.wp-admin h3:not(.editor-visual-editor h3),
body.wp-admin h4:not(.editor-visual-editor h4),
body.wp-admin h5:not(.editor-visual-editor h5),
body.wp-admin h6:not(.editor-visual-editor h6) {
font-family: unset !important;
font-style: unset !important;
font-size: unset !important;
line-height: unset !important;
letter-spacing: unset !important;
text-transform: unset !important;
text-align: unset !important;
}
font-family: initial !important;
font-style: initial !important;
font-size: initial !important;
line-height: initial !important;
letter-spacing: initial !important;
text-transform: initial !important;
text-align: initial !important;
} */
.nunito {
font-family: 'Nunito Sans', sans-serif;

View File

@ -53,7 +53,7 @@
li.menu-item {
@apply font-medium
text-sm
text-lg
text-center;
&:hover > a,
@ -99,9 +99,9 @@
}
li.menu-item.has-page-icon {
@apply flex flex-col items-center justify-end gap-3;
@apply flex flex-col items-center justify-end gap-4 font-normal tracking-wide;
.page_icon {
@apply w-5 h-5 object-contain object-center;
@apply w-7 h-7 object-contain object-center;
}
}
li.menu-item.menu-item-has-children:hover {
@ -311,3 +311,14 @@ button#burger-menu-toggle {
}
}
}
.tools-container {
@apply flex flex-row items-center gap-4;
button {
@apply flex flex-col items-center gap-4 text-lg;
img {
@apply filter-white w-6 h-6;
}
}
}

View File

@ -0,0 +1,12 @@
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="15" cy="15" r="15" fill="#136F63"/>
<g clip-path="url(#clip0_29_1368)">
<path d="M20.3663 9.65656L10.0381 21.0939" stroke="white" stroke-width="2"/>
<path d="M20.3668 22V9.65656H9" stroke="white" stroke-width="2"/>
</g>
<defs>
<clipPath id="clip0_29_1368">
<rect width="12" height="13" fill="white" transform="translate(9 9)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 463 B

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="abonner" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 32">
<defs>
<style>
.cls-1 {
fill: none;
stroke: #000;
stroke-width: 2px;
}
</style>
</defs>
<path d="M0,27v-3.87l3.98-3.97V5.61L9.61,0h8.77l5.63,5.61v13.54l3.98,3.97v3.87"/>
<path class="cls-1" d="M9,31h10"/>
</svg>

After

Width:  |  Height:  |  Size: 376 B

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="rechercher" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25.71 26.71">
<defs>
<style>
.cls-1, .cls-2 {
fill: none;
stroke: #000;
stroke-width: 2px;
}
.cls-2 {
stroke-miterlimit: 10;
}
</style>
</defs>
<path class="cls-1" d="M18.84,19.83l6.16,6.17"/>
<ellipse class="cls-2" cx="11.52" cy="11.96" rx="10.52" ry="10.96"/>
</svg>

After

Width:  |  Height:  |  Size: 449 B

View File

@ -1,36 +0,0 @@
<?php
// $latest_posts_details = get_field('latest_posts_details');
?>
<section class="section_latest_news">
<h2 class="section_title">Lastest Articles</h2>
<div class="articles_container">
<?php
$recent_posts = wp_get_recent_posts(array(
'numberposts' => 4, // Number of recent posts thumbnails to display
'post_status' => 'publish' // Show only the published posts
));
foreach ($recent_posts as $key => $post) {
$post_date = date_i18n('j F Y', strtotime($post['post_date']));
?>
<div class="article_card">
<p>qsdqsd</p>
<?php echo get_the_post_thumbnail($post['ID'], 'full', array('class' => 'article_thumbnail')); ?>
<div class="card_inner">
<h4 class="post_date"> <?php echo $post_date ?> </h4>
<h3 class="post_title"><?php echo $post['post_title'] ?></h3>
<p><?php echo $post['post_excerpt'] ?></p>
</div>
</div>
<?php
}
?>
</div>
</section>

View File

@ -1,21 +0,0 @@
{
"name": "acf/home-header",
"title": "Home — Section d'accueil",
"category": "client-blocks",
"multiple": false,
"icon": {
"foreground": "#ffbb00",
"src": "admin-site-alt"
},
"keywords": [
"Couverture",
"home",
"Accueil",
"Section d'accueil",
"Header"
],
"acf": {
"mode": "auto",
"renderTemplate": "home-header.php"
}
}

View File

@ -1,18 +0,0 @@
<?php
$home_header = get_field('home_header_datas');
?>
<section class="home-header header_top">
<div class="home-header__content">
<h1 class="home-header__title">
<?php echo $home_header['title'] ?>
</h1>
<a class="cta" href="<?php echo $home_header['cta']['url'] ?>">
<?php echo $home_header['cta']['title'] ?>
</a>
</div>
<img class="home-header__cover" src='<?php echo $home_header['cover_illustration']['url'] ?>' alt=''>
</section>