Compare commits
No commits in common. "ee3797a14d9de06f781cf0e49926b05e88be7c8f" and "ace090cb4b317e5ea33162af429c939f609aa244" have entirely different histories.
ee3797a14d
...
ace090cb4b
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
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');
|
||||
|
|
|
|||
101
includes/blocks.php
Executable file
101
includes/blocks.php
Executable file
|
|
@ -0,0 +1,101 @@
|
|||
<?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' );
|
||||
|
|
@ -1 +1,73 @@
|
|||
<?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');
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
@import './base/base.css';
|
||||
@import './base/typography.css';
|
||||
@import './base/filters.css';
|
||||
@import './base/links.css';
|
||||
/* @import './base/swiper.css'; */
|
||||
|
||||
/* ########### COMPONENTS ############ */
|
||||
|
|
|
|||
|
|
@ -3,6 +3,3 @@
|
|||
sepia(26%) saturate(1165%) hue-rotate(123deg)
|
||||
brightness(93%) contrast(93%);
|
||||
}
|
||||
.filter-white {
|
||||
filter: brightness(0) saturate(100%) invert(100%);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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 .editor-visual-editor,
|
||||
body:not(.wp-admin) {
|
||||
|
||||
body {
|
||||
font-family: 'Nunito Sans', sans-serif;
|
||||
/* @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;
|
||||
}
|
||||
@apply text-primary text-xl;
|
||||
}
|
||||
|
||||
h1 {
|
||||
@apply text-6xl;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-family: 'Fjalla One', sans-serif;
|
||||
@apply text-primary;
|
||||
}
|
||||
|
||||
h2 {
|
||||
@apply text-5xl;
|
||||
}
|
||||
h1 {
|
||||
@apply text-6xl;
|
||||
}
|
||||
|
||||
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: 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;
|
||||
} */
|
||||
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;
|
||||
}
|
||||
|
||||
.nunito {
|
||||
font-family: 'Nunito Sans', sans-serif;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
li.menu-item {
|
||||
@apply font-medium
|
||||
text-lg
|
||||
text-sm
|
||||
text-center;
|
||||
|
||||
&:hover > a,
|
||||
|
|
@ -99,9 +99,9 @@
|
|||
}
|
||||
|
||||
li.menu-item.has-page-icon {
|
||||
@apply flex flex-col items-center justify-end gap-4 font-normal tracking-wide;
|
||||
@apply flex flex-col items-center justify-end gap-3;
|
||||
.page_icon {
|
||||
@apply w-7 h-7 object-contain object-center;
|
||||
@apply w-5 h-5 object-contain object-center;
|
||||
}
|
||||
}
|
||||
li.menu-item.menu-item-has-children:hover {
|
||||
|
|
@ -311,14 +311,3 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
<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>
|
||||
|
Before Width: | Height: | Size: 463 B |
|
|
@ -1,14 +0,0 @@
|
|||
<?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>
|
||||
|
Before Width: | Height: | Size: 376 B |
|
|
@ -1,18 +0,0 @@
|
|||
<?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>
|
||||
|
Before Width: | Height: | Size: 449 B |
36
template-blocks/generics/latest-post-query.php
Normal file
36
template-blocks/generics/latest-post-query.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?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>
|
||||
21
template-blocks/home/home-header/block.json
Normal file
21
template-blocks/home/home-header/block.json
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
0
template-blocks/home/home-header/home-header.css
Executable file
0
template-blocks/home/home-header/home-header.css
Executable file
18
template-blocks/home/home-header/home-header.php
Executable file
18
template-blocks/home/home-header/home-header.php
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
<?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>
|
||||
Loading…
Reference in New Issue
Block a user