init
This commit is contained in:
commit
a1197b69b8
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
.gitattributes export-ignore
|
||||
/.github/ export-ignore
|
||||
14
.gitignore
vendored
Normal file
14
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/node_modules
|
||||
/.idea
|
||||
/.vscode
|
||||
.DS_Store
|
||||
*/.DS_Store
|
||||
Makefile
|
||||
init_script.sh
|
||||
/css
|
||||
/js
|
||||
.env
|
||||
.env-sample
|
||||
.env-dev
|
||||
.env-prod
|
||||
Makefile
|
||||
6
.prettierrc
Normal file
6
.prettierrc
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"tabWidth": 2,
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"printWidth": 60
|
||||
}
|
||||
24
404.php
Normal file
24
404.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?> class="no-js">
|
||||
<head>
|
||||
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link rel="profile" href="http://gmpg.org/xfn/11">
|
||||
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
<body class="antialiased">
|
||||
<div class="md:flex min-h-screen">
|
||||
<div class="w-full md:w-1/2 flex items-center justify-center">
|
||||
<div class="max-w-sm m-8">
|
||||
<div class="text-5xl md:text-15xl text-gray-800 border-primary border-b">404</div>
|
||||
<div class="w-16 h-1 bg-purple-light my-3 md:my-6"></div>
|
||||
<p class="text-gray-800 text-2xl md:text-3xl font-light mb-8"><?php _e( 'Sorry, the page you are looking for could not be found.', 'tailpress' ); ?></p>
|
||||
<a href="<?php echo get_bloginfo( 'url' ); ?>" class="bg-primary px-4 py-2 rounded text-white">
|
||||
<?php _e( 'Go Home', 'tailpress' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
103
CHANGELOG.md
Normal file
103
CHANGELOG.md
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
# Changelog
|
||||
|
||||
All notable changes to TailPress will be documented in this file.
|
||||
|
||||
## Unreleased
|
||||
|
||||
## 3.1.0
|
||||
- Tailwind font sizes are now set as defined in `theme.json`.
|
||||
- Breakpoints now based on WordPress defaults (https://developer.wordpress.org/block-editor/reference-guides/packages/packages-viewport/#usage).
|
||||
- Providing `w-content`, `max-w-content`, `w-wide` and `max-w-wide` utility classes.
|
||||
- Content width is now actually the width as defined in `theme.json`.
|
||||
- Fixing align wide, width as defined in `theme.json`.
|
||||
- Updating Tailwind CSS to version 3.1.0.
|
||||
- Fix issues package.json scripts on Windows.
|
||||
|
||||
## 3.0.0 - 2021-12-14
|
||||
|
||||
- Updating Tailwind to 3.0.0.
|
||||
|
||||
### TailPress installer
|
||||
|
||||
- The TailPress installer (^0.2.0) now allows you to use Laravel Mix instead of esbuild by setting --compiler=mix.
|
||||
- You may now also set dbname, dbuser, dbpass and dbhost.
|
||||
|
||||
## 2.0.0 - 2021-09-03
|
||||
|
||||
- Switching to Tailwind CLI and esbuild instead of LaraveL Mix.
|
||||
- Removing `theme` subdirectory setup as it is no longer needed with the new build setup.
|
||||
- Removing `TailPress` class and it's functions (`tailpress()->get_header()` etc.) throughout the theme.
|
||||
- New `tailpress_asset` function to get the URL of an asset (previously `tailpress_mix`).
|
||||
- `tailpress_asset` function thaty appends a `time` parameter if [wp_get_environment_type()](https://developer.wordpress.org/reference/functions/wp_get_environment_type/) does not return `production` for cache busting (instead of the previously used versioned assets through `mix-manifest.json`).
|
||||
- Update screenshot.png.
|
||||
- Remove `block-editor.css`, only use `editor-style.css`.
|
||||
- Moving `editor-style.css` from root to `css` directory.
|
||||
- Update readme.
|
||||
|
||||
## 1.0.0 - 2021-08-25
|
||||
|
||||
- Replace `tailpress.json` with `theme.json` as used by WordPress core.
|
||||
- Move template files into `theme` subdirectory.
|
||||
- Move tailwind plugin to a [separate repository](https://github.com/jeffreyvr/tailwindcss-tailpress).
|
||||
- Update readme and adding section on using installer.
|
||||
|
||||
## 0.1.0 - 2021-06-17
|
||||
|
||||
- No longer depending on jQuery.
|
||||
- Fixes text color classes for the Block Editor.
|
||||
- Use safelist.txt to prevent WP classes from being purged.
|
||||
- Readme changes.
|
||||
- MIT License.
|
||||
|
||||
## 0.0.9 - 2021-04-05
|
||||
|
||||
- Updating to Tailwind CSS v2.1 which includes the JIT engine in core among other things.
|
||||
|
||||
## 0.0.8 - 2021-03-23
|
||||
|
||||
- Using TailwindCSS JIT for way faster compiling.
|
||||
- Updated readme.
|
||||
- Fix loading styling in block editor.
|
||||
- Check if mix-manifest.json file exists to prevent warning message.
|
||||
|
||||
## 0.0.7 - 2021-02-15
|
||||
|
||||
- Adding the option to apply submenu_class to the wp_nav_menu args.
|
||||
- Adding the option to apply classes on li_class and submenu_class on specific depths, like: li_class_0.
|
||||
|
||||
### 0.0.6 - 2021-02-08
|
||||
|
||||
- Fixes issue on Windows.
|
||||
|
||||
## 0.0.5 - 2020-12-24
|
||||
|
||||
- Set selectors on single line since this seems to cause issues (nested CSS) with production build (#241a612).
|
||||
|
||||
## 0.0.4 - 2020-12-23
|
||||
|
||||
- Add nested CSS support for PostCSS.
|
||||
- Minor readme changes.
|
||||
|
||||
## 0.0.3 - 2020-12-22
|
||||
|
||||
- Update Laravel Mix from version 5^ to 6^.
|
||||
- Removing Laravel Mix Tailwind, defining plugins within webpack.mix.js instead.
|
||||
- Switching from Sass to PostCSS for faster compiling.
|
||||
- Moved TailPress colors and font size settings to tailpress.json file.
|
||||
- Use tailpress.json to populate editor-color-palette and editor-font-sizes theme support automatically.
|
||||
- New screenshot.
|
||||
- Update readme.
|
||||
- Other minor fixes and improvements.
|
||||
|
||||
## 0.0.2 - 2020-11-24
|
||||
|
||||
- Adding basic support for the block editor Gutenberg by generating alignment, font size and color classes.
|
||||
Contains four theme colors out of the box, being primary, secondary, dark and light. This is adjustable of course.
|
||||
- Loading a editor-style.css.
|
||||
- Removing double slashes on resulting manifest asset URLs.
|
||||
- Modified template files to have a better starting point (including horizontal main navigation, footer always at the bottom for short pages).
|
||||
- Added a basic 404 page template.
|
||||
|
||||
## 0.0.1 - 2020-11-19
|
||||
|
||||
- Init release.
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Jeffrey van Rossum <jeffrey@vanrossum.dev>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
3
README.MD
Normal file
3
README.MD
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
A custom Theme made by Deligraph using Tailwind and Laravel Mix
|
||||
|
||||
https://deligraph.com/
|
||||
74
comments.php
Normal file
74
comments.php
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
/**
|
||||
* If the current post is protected by a password and
|
||||
* the visitor has not yet entered the password we will
|
||||
* return early without loading the comments.
|
||||
*/
|
||||
if ( post_password_required() ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="comments" class="comments-area my-8">
|
||||
|
||||
<?php if ( have_comments() ) : ?>
|
||||
<h2 class="comments-title">
|
||||
<?php
|
||||
printf(
|
||||
_nx( 'One comment', '%1$s comments', get_comments_number(), 'comments title', 'tailpress' ),
|
||||
number_format_i18n( get_comments_number() ),
|
||||
get_the_title()
|
||||
);
|
||||
?>
|
||||
</h2>
|
||||
|
||||
<ol class="comment-list">
|
||||
<?php
|
||||
wp_list_comments(
|
||||
array(
|
||||
'style' => 'ol',
|
||||
'short_ping' => true,
|
||||
'avatar_size' => 56,
|
||||
)
|
||||
);
|
||||
?>
|
||||
</ol>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
|
||||
|
||||
<nav class="comment-navigation" id="comment-nav-above">
|
||||
|
||||
<h1 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'tailpress' ); ?></h1>
|
||||
|
||||
<?php if ( get_previous_comments_link() ) { ?>
|
||||
<div class="nav-previous">
|
||||
<?php previous_comments_link( __( '← Older Comments', 'tailpress' ) ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( get_next_comments_link() ) { ?>
|
||||
<div class="nav-next">
|
||||
<?php next_comments_link( __( 'Newer Comments →', 'tailpress' ) ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</nav><!-- #comment-nav-above -->
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
|
||||
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'tailpress' ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
comment_form(
|
||||
array(
|
||||
'class_submit' => 'bg-primary text-white cursor-pointer rounded font-bold py-2 px-4',
|
||||
'comment_field' => '<textarea id="comment" name="comment" class="bg-gray-200 w-full py-2 px-3" aria-required="true"></textarea>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
</div>
|
||||
22
footer.php
Normal file
22
footer.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
</main>
|
||||
|
||||
<?php do_action( 'tailpress_content_end' ); ?>
|
||||
|
||||
|
||||
<?php do_action( 'tailpress_content_after' ); ?>
|
||||
|
||||
<footer id="colophon" class="site-footer bg-gray-50 py-12" role="contentinfo">
|
||||
<?php do_action( 'tailpress_footer' ); ?>
|
||||
|
||||
<div class="container mx-auto text-center text-gray-500">
|
||||
© <?php echo date_i18n( 'Y' );?> - <?php echo get_bloginfo( 'name' );?>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<?php wp_footer(); ?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
17
front-page.php
Executable file
17
front-page.php
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
<?php get_header(); ?>
|
||||
|
||||
|
||||
<?php if ( have_posts() ) : ?>
|
||||
<?php
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
the_content();
|
||||
?>
|
||||
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
get_footer();
|
||||
13
functions.php
Normal file
13
functions.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
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');
|
||||
|
||||
// require_once(__DIR__ . '/includes/widget.php');
|
||||
// require_once( __DIR__ . '/includes/taxonomy.php');
|
||||
// require_once( __DIR__ . '/includes/errorlog.php');
|
||||
// require_once( __DIR__ . '/includes/logos.php');
|
||||
154
header.php
Normal file
154
header.php
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
<!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?>>
|
||||
|
||||
<head>
|
||||
<meta charset="<?php bloginfo('charset'); ?>">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<link rel="profile" href="http://gmpg.org/xfn/11">
|
||||
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>">
|
||||
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
do_action('tailpress_site_before');
|
||||
global $post;
|
||||
?>
|
||||
|
||||
<div id="page-<?php echo $post->post_name ?>" class="min-h-screen flex flex-col">
|
||||
|
||||
<?php do_action('tailpress_header'); ?>
|
||||
|
||||
<!-- <header id="primary-header">
|
||||
<div class="primary-menu-container">
|
||||
<div class="lg:flex lg:justify-between lg:items-center py-6">
|
||||
<div class="flex justify-between items-center">
|
||||
<div>
|
||||
<?php if (has_custom_logo()) { ?>
|
||||
<?php the_custom_logo(); ?>
|
||||
<?php } else { ?>
|
||||
<a href="<?php echo get_bloginfo('url'); ?>" class="font-extrabold text-lg uppercase">
|
||||
<?php echo get_bloginfo('name'); ?>
|
||||
</a>
|
||||
|
||||
<p class="text-sm font-light text-gray-600">
|
||||
<?php echo get_bloginfo('description'); ?>
|
||||
</p>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div class="lg:hidden">
|
||||
<a href="#" aria-label="Toggle navigation" id="primary-menu-toggle">
|
||||
<svg viewBox="0 0 20 20" class="inline-block w-6 h-6" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g stroke="none" stroke-width="1" fill="currentColor" fill-rule="evenodd">
|
||||
<g id="icon-shape">
|
||||
<path d="M0,3 L20,3 L20,5 L0,5 L0,3 Z M0,9 L20,9 L20,11 L0,11 L0,9 Z M0,15 L20,15 L20,17 L0,17 L0,15 Z" id="Combined-Shape"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
wp_nav_menu(
|
||||
array(
|
||||
'container_id' => 'primary-menu',
|
||||
'container_class' => 'bg-primary mt-4 p-4 lg:mt-0 lg:p-0 lg:bg-transparent lg:block',
|
||||
'menu_class' => 'lg:flex lg:-mx-4',
|
||||
'theme_location' => 'primary',
|
||||
'li_class' => 'lg:mx-4 menu-navlink',
|
||||
'fallback_cb' => false,
|
||||
)
|
||||
);
|
||||
?>
|
||||
<img class="close_btn" src="<?php echo get_template_directory_uri() . '/resources/img/close_menu_icon.svg' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
</header> -->
|
||||
|
||||
<header id="primary-header">
|
||||
<!-- <div class="primary-menu-container bg-red-500">
|
||||
</div> -->
|
||||
<div class="primary-menu-container lg:flex lg:justify-between lg:items-center">
|
||||
<nav id="primary-menu-nav" class="flex justify-between items-center">
|
||||
<!-- <div class="website_logo">
|
||||
<?php if ($logo_gba) { ?>
|
||||
<a href="<?php echo home_url() ?>">
|
||||
<img class="logo" src=<?php echo $logo_gba ?> alt="">
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
<a href="<?php echo get_bloginfo('url'); ?>" class="font-extrabold text-lg uppercase">
|
||||
<?php echo get_bloginfo('name'); ?>
|
||||
</a>
|
||||
|
||||
<p class="text-sm font-light text-gray-600">
|
||||
<?php echo get_bloginfo('description'); ?>
|
||||
</p>
|
||||
|
||||
<?php } ?>
|
||||
</div> -->
|
||||
<div class="website_logo">
|
||||
<?php if (has_custom_logo()) { ?>
|
||||
<?php the_custom_logo(); ?>
|
||||
<?php } else { ?>
|
||||
<a href=" <?php echo get_bloginfo('url'); ?>" class="font-extrabold text-lg uppercase">
|
||||
<?php echo get_bloginfo('name'); ?>
|
||||
</a>
|
||||
|
||||
<p class="text-sm font-light text-gray-600">
|
||||
<?php echo get_bloginfo('description'); ?>
|
||||
</p>
|
||||
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<button id="burger-menu-toggle" aria-label="<?php echo esc_html_e("Ouvrir le menu", 'deligraph-theme') ?>">
|
||||
<div class="menu-toggle-bar menu-toggle-bar--top"></div>
|
||||
<div class="menu-toggle-bar menu-toggle-bar--middle"></div>
|
||||
<div class="menu-toggle-bar menu-toggle-bar--bottom"></div>
|
||||
<!-- <?php echo get_template_part('resources/svg/burger-menu-icon.svg'); ?> -->
|
||||
</button>
|
||||
<div id="primary-menu">
|
||||
<!-- <button id="close-menu-btn" aria-label="<?php echo esc_html_e("Fermer le menu", 'deligraph-theme') ?>">
|
||||
<?php echo get_template_part('resources/svg/close-menu-icon.svg'); ?>
|
||||
</button> -->
|
||||
<?php
|
||||
wp_nav_menu(
|
||||
array(
|
||||
'container' => 'false',
|
||||
// 'container_id' => 'primary-menu',
|
||||
// 'container_class' => '',
|
||||
'theme_location' => 'primary',
|
||||
'li_class' => 'menu-navlink',
|
||||
'fallback_cb' => false,
|
||||
)
|
||||
); ?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- qsdqds -->
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
<?php if (is_front_page()) { ?>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php do_action('tailpress_content_start'); ?>
|
||||
|
||||
<main id="content" class="site-content flex-grow">
|
||||
41
includes/admin.php
Normal file
41
includes/admin.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
// #### ADMIN STYLE
|
||||
function my_custom_admin()
|
||||
{
|
||||
wp_enqueue_style('admin_styles', get_template_directory_uri() . '/css/admin-style.css');
|
||||
}
|
||||
|
||||
add_action('admin_head', 'my_custom_admin');
|
||||
|
||||
// ##### REMOVE FROM ADMIN MENU
|
||||
function custom_menu_page_removing()
|
||||
{
|
||||
// remove_menu_page('edit.php'); // Hide Articles
|
||||
remove_menu_page('edit-comments.php'); // Hide Commentaires
|
||||
}
|
||||
add_action('admin_menu', 'custom_menu_page_removing');
|
||||
|
||||
|
||||
// ##### Removes from admin bar
|
||||
function mytheme_admin_bar_render()
|
||||
{
|
||||
global $wp_admin_bar;
|
||||
$wp_admin_bar->remove_menu('comments');
|
||||
}
|
||||
add_action('wp_before_admin_bar_render', 'mytheme_admin_bar_render');
|
||||
|
||||
|
||||
// ##### MODIFIER LE LIEN DU LOGO SUR LA BLADE DE CONNEXION À L'INTERFACE ADMIN
|
||||
function change_login_logo_url($url)
|
||||
{
|
||||
return site_url();
|
||||
}
|
||||
add_filter('login_headerurl', 'change_login_logo_url');
|
||||
|
||||
// ##### ENQUEUE DU CSS BLADE LOGIN ADMIN
|
||||
function enqueue_custom_login_stylesheet()
|
||||
{
|
||||
wp_enqueue_style('custom-login', get_stylesheet_directory_uri() . '/style-login.css');
|
||||
}
|
||||
add_action('login_enqueue_scripts', 'enqueue_custom_login_stylesheet');
|
||||
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' );
|
||||
19
includes/errorlog.php
Executable file
19
includes/errorlog.php
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
// #################################
|
||||
// FUNCTION ERROR LOG
|
||||
// #################################
|
||||
|
||||
|
||||
// Error log
|
||||
if (!function_exists('write_log')) {
|
||||
function write_log($log) {
|
||||
if (true === WP_DEBUG) {
|
||||
if (is_array($log) || is_object($log)) {
|
||||
error_log(print_r($log, true));
|
||||
} else {
|
||||
error_log($log);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
159
includes/init.php
Normal file
159
includes/init.php
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Theme setup.
|
||||
*/
|
||||
function tailpress_setup()
|
||||
{
|
||||
|
||||
// ##### Setup 🡒 Navigation
|
||||
|
||||
register_nav_menus(
|
||||
array(
|
||||
'primary' => __('Primary Menu', 'tailpress'),
|
||||
)
|
||||
);
|
||||
|
||||
// ##### Setup 🡒 Ajout des themes supports
|
||||
|
||||
add_theme_support(
|
||||
'html5',
|
||||
array(
|
||||
'search-form',
|
||||
'comment-form',
|
||||
'comment-list',
|
||||
'gallery',
|
||||
'caption',
|
||||
)
|
||||
);
|
||||
add_theme_support('title-tag');
|
||||
add_theme_support('custom-logo');
|
||||
add_theme_support('post-thumbnails');
|
||||
|
||||
add_theme_support('align-wide');
|
||||
add_theme_support('wp-block-styles');
|
||||
|
||||
add_theme_support('editor-styles');
|
||||
add_editor_style('css/editor-style.css');
|
||||
add_theme_support('widgets');
|
||||
// add_post_type_support( 'page', 'excerpt' );
|
||||
}
|
||||
|
||||
add_action('after_setup_theme', 'tailpress_setup');
|
||||
|
||||
|
||||
|
||||
// ##### Menu Walker
|
||||
// if (!function_exists('register_navwalker')) :
|
||||
// function register_navwalker() {
|
||||
// require('includes/navwalker.php');
|
||||
// }
|
||||
// endif;
|
||||
// add_action('after_setup_theme', 'register_navwalker');
|
||||
|
||||
|
||||
|
||||
|
||||
// ##### Walker to ReWrap li submenu parent with button instead of <a>
|
||||
function wrap_parent_menu_item_buttons($output, $item, $depth, $args)
|
||||
{
|
||||
|
||||
if ($args->theme_location === "primary" && in_array('menu-item-has-children', $item->classes, true)) {
|
||||
$output = '<button type="button" class="menu-item-submenu-toggle" aria-expanded="false" aria-controls="sub-menu-' . $item->ID . '">' . $item->title . '</button>';
|
||||
}
|
||||
if ($args->theme_location === "footer" && in_array('menu-item-has-children', $item->classes, true)) {
|
||||
$output = $item->title;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
add_filter('walker_nav_menu_start_el', 'wrap_parent_menu_item_buttons', 10, 4);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ##### Enqueue Theme assets 🡒 Front
|
||||
|
||||
function tailpress_enqueue_scripts()
|
||||
{
|
||||
$theme = wp_get_theme();
|
||||
|
||||
wp_enqueue_style('tailpress', tailpress_asset('css/app.css'), array(), $theme->get('Version'));
|
||||
wp_enqueue_script('tailpress', tailpress_asset('js/app.js'), array(), $theme->get('Version'));
|
||||
}
|
||||
|
||||
|
||||
// ##### Enqueue Theme assets 🡒 Back
|
||||
|
||||
function enqueue_gutenberg_back_styles()
|
||||
{
|
||||
wp_enqueue_style('tailpress_back', tailpress_asset('css/app.css'), array());
|
||||
}
|
||||
add_action('enqueue_block_editor_assets', 'enqueue_gutenberg_back_styles');
|
||||
|
||||
|
||||
add_action('wp_enqueue_scripts', 'tailpress_enqueue_scripts');
|
||||
|
||||
/**
|
||||
* Get asset path.
|
||||
*
|
||||
* @param string $path Path to asset.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function tailpress_asset($path)
|
||||
{
|
||||
if (wp_get_environment_type() === 'production') {
|
||||
return get_stylesheet_directory_uri() . '/' . $path;
|
||||
}
|
||||
|
||||
return add_query_arg('time', time(), get_stylesheet_directory_uri() . '/' . $path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds option 'li_class' to 'wp_nav_menu'.
|
||||
*
|
||||
* @param string $classes String of classes.
|
||||
* @param mixed $item The curren item.
|
||||
* @param WP_Term $args Holds the nav menu arguments.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function tailpress_nav_menu_add_li_class($classes, $item, $args, $depth)
|
||||
{
|
||||
if (isset($args->li_class)) {
|
||||
$classes[] = $args->li_class;
|
||||
}
|
||||
|
||||
if (isset($args->{"li_class_$depth"})) {
|
||||
$classes[] = $args->{"li_class_$depth"};
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
add_filter('nav_menu_css_class', 'tailpress_nav_menu_add_li_class', 10, 4);
|
||||
|
||||
/**
|
||||
* Adds option 'submenu_class' to 'wp_nav_menu'.
|
||||
*
|
||||
* @param string $classes String of classes.
|
||||
* @param mixed $item The curren item.
|
||||
* @param WP_Term $args Holds the nav menu arguments.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function tailpress_nav_menu_add_submenu_class($classes, $args, $depth)
|
||||
{
|
||||
if (isset($args->submenu_class)) {
|
||||
$classes[] = $args->submenu_class;
|
||||
}
|
||||
|
||||
if (isset($args->{"submenu_class_$depth"})) {
|
||||
$classes[] = $args->{"submenu_class_$depth"};
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
add_filter('nav_menu_submenu_css_class', 'tailpress_nav_menu_add_submenu_class', 10, 3);
|
||||
34
includes/logos.php
Executable file
34
includes/logos.php
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
/** ------------------------------
|
||||
ENABLE SVG
|
||||
------------------------------*/
|
||||
|
||||
/* <?xml version="1.0" encoding="utf-8"?> */
|
||||
|
||||
function cc_mime_types($mimes)
|
||||
{
|
||||
$mimes['svg'] = 'image/svg+xml';
|
||||
return $mimes;
|
||||
}
|
||||
add_filter('upload_mimes', 'cc_mime_types');
|
||||
|
||||
|
||||
// #############################
|
||||
// AJOUT D'UN ESPACE LOGO CUSTOM
|
||||
// #############################
|
||||
|
||||
// function add_logo_customizer_settings($wp_customize)
|
||||
// {
|
||||
// $wp_customize->add_setting('logo_semlex_dark');
|
||||
|
||||
// // Add a control to upload the hover logo
|
||||
// $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logo_semlex_dark', array(
|
||||
// 'label' => 'Logo Semlex Sombre',
|
||||
// 'section' => 'title_tagline', //this is the section where the custom-logo from WordPress is
|
||||
// 'settings' => 'logo_semlex_dark',
|
||||
// 'priority' => 8 // show it just below the custom-logo
|
||||
// )));
|
||||
// }
|
||||
|
||||
// add_action('customize_register', 'add_logo_customizer_settings');
|
||||
28
includes/navwalker.php
Normal file
28
includes/navwalker.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
class wp_nav_menu_walker extends Walker_Nav_menu
|
||||
{
|
||||
|
||||
function start_lvl(&$output, $depth = 0, $args = null)
|
||||
{
|
||||
|
||||
$tmp_class = "child-" . $depth;
|
||||
|
||||
$output .= "<ul class='" . $tmp_class . "'>";
|
||||
|
||||
}
|
||||
|
||||
function start_el(&$output, $item, $depth = 0, $args = null, $id = 0)
|
||||
{
|
||||
|
||||
$output .= "<li>I like pie" . $item->title;
|
||||
|
||||
// var_dump($args);
|
||||
}
|
||||
|
||||
function end_el(&$output, $item, $depth = 0, $args = null)
|
||||
{
|
||||
$output .= "...</li>";
|
||||
}
|
||||
|
||||
}
|
||||
106
includes/nawalker_fction.php
Normal file
106
includes/nawalker_fction.php
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
<?php
|
||||
|
||||
/* -----------------------------------------------------------
|
||||
Walker to ReWrap li submenu parent with button instead of
|
||||
-----------------------------------------------------------*/
|
||||
|
||||
function wrap_parent_menu_item_buttons($output, $item, $depth, $args)
|
||||
{
|
||||
// write_log($item);
|
||||
|
||||
// $item->classes = array_merge($item->classes, array('menu-item-' . $item->ID));
|
||||
|
||||
// #### MENU HOMEGRADE HEADER
|
||||
if ($args->theme_location === "homegrade" && $args->menu_id === "menu-homegrade-navlist" && in_array('menu-item-has-children', $item->classes, true)) {
|
||||
$output = '<button type="button" class="menu-item-submenu-toggle" aria-expanded="false" aria-controls="sub-menu-' . $item->ID . '">' . $item->title . '</button>';
|
||||
}
|
||||
|
||||
// #### MENU HOMEGRADE FOOTER
|
||||
if ($args->theme_location === "homegrade" && $args->menu_class === "menu-homegrade-footer" && in_array('menu-item-has-children', $item->classes, true)) {
|
||||
$output = '<h6 class="page-group-title">' . $item->title . '</h6>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($args->theme_location === "renovateur") {
|
||||
$page_icon = get_field('page_icon', $item->object_id);
|
||||
|
||||
if (in_array('menu-item-has-children', $item->classes, true)) {
|
||||
$output = '<button type="button" class="menu-item-submenu-toggle" aria-expanded="false" aria-controls="sub-menu-' . $item->ID . '">' . $item->title . '</button>';
|
||||
}
|
||||
|
||||
// #### ICONE DE PAGE FOR TOP LEVEL MENU ITEMS
|
||||
if (isset($page_icon)) {
|
||||
$icon = '<img class="page_icon" src="' . $page_icon['url'] . '" alt=""/>';
|
||||
$link = $output;
|
||||
$output = $icon . $link;
|
||||
}
|
||||
|
||||
write_log($output);
|
||||
|
||||
// #### TAXONOMY : GET ICON & INFOS ABOUT TAX
|
||||
|
||||
if ($item->type === "taxonomy") {
|
||||
$term = get_term_by('id', $item->object_id, 'thematiques');
|
||||
$cover = get_field('taxonomy_pictures', "thematiques_" . $item->object_id);
|
||||
|
||||
$output = '<a class="lol" href="' . $item->url . '">';
|
||||
$output .= '<img class="thematique-icon" src="' . $cover['icon']['url'] . '"/>';
|
||||
$output .= '<h6>' . $item->title . "</h6>";
|
||||
$output .= '<p>' . $term->description . "</p>";
|
||||
$output .= "</a>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($args->theme_location === "footer" && in_array('menu-item-has-children', $item->classes, true)) {
|
||||
$output = $item->title;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
add_filter('walker_nav_menu_start_el', 'wrap_parent_menu_item_buttons', 10, 4);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------
|
||||
Pass Specific submenus-classnames for menu renovateur
|
||||
-----------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
function customize_submenu_classnames($classes, $args, $depth)
|
||||
{
|
||||
// Here we can additionally use menu arguments.
|
||||
// if ($args->theme_location === "renovateur") {
|
||||
// $default_class_name_key = array_search('sub-menu', $classes);
|
||||
|
||||
// if (false !== $default_class_name_key) {
|
||||
// unset($classes[$default_class_name_key]);
|
||||
// }
|
||||
// $classes[] = 'header-submenu';
|
||||
// $classes[] = "depth-{$depth}";
|
||||
// $classes[] = 'sub-menu';
|
||||
// $classes[] = 'test';
|
||||
// }
|
||||
// write_log($classes);
|
||||
// write_log($classes);
|
||||
|
||||
return $classes;
|
||||
}
|
||||
// add_filter('nav_menu_submenu_css_class', 'customize_submenu_classnames', 10, 3);
|
||||
|
||||
|
||||
/* -----------------------------------------------------------
|
||||
FILTER MENU OBJECTS TO BE DISPLAYED
|
||||
-----------------------------------------------------------*/
|
||||
|
||||
|
||||
function wpdocs_unset_menu_items($menu_objects, $args)
|
||||
{
|
||||
if ($args->theme_location === "renovateur") {
|
||||
}
|
||||
return $menu_objects;
|
||||
}
|
||||
// add_filter('wp_nav_menu_objects', 'wpdocs_unset_menu_items', 10, 2);
|
||||
29
includes/post_types.php
Normal file
29
includes/post_types.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
// #### POST TYPES
|
||||
function create_posttype()
|
||||
{
|
||||
|
||||
register_post_type(
|
||||
'search-and-find',
|
||||
// CPT Options
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => __('Cherche & trouve'),
|
||||
'singular_name' => __('Cherche & trouve')
|
||||
),
|
||||
'public' => true,
|
||||
'has_archive' => true,
|
||||
'rewrite' => array('slug' => 'cherche-et-trouve'),
|
||||
'show_in_rest' => true,
|
||||
'menu_icon' => 'dashicons-table-row-delete',
|
||||
'menu_position' => 4,
|
||||
'supports' => array('title', 'custom-fields', 'editor'),
|
||||
|
||||
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action('init', 'create_posttype');
|
||||
279
includes/shortcuts/shortcuts.php
Normal file
279
includes/shortcuts/shortcuts.php
Normal file
|
|
@ -0,0 +1,279 @@
|
|||
<?php
|
||||
|
||||
define('WP_DEBUG', true);
|
||||
define('WP_DEBUG_LOG', true);
|
||||
define('WP_DEBUG_DISPLAY', false);
|
||||
|
||||
|
||||
|
||||
// ##### Syntax
|
||||
?>
|
||||
|
||||
|
||||
<?php if ($var) : ?>
|
||||
<p><?php echo $var['title'] ?></p>
|
||||
<?php else : ?>
|
||||
<p>Alternative content when $var is falsy or null</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($var) { ?>
|
||||
<p><?php echo $var['title'] ?></p>
|
||||
<?php }; ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
// ##### Template parts 🡒 Get templates parts
|
||||
|
||||
get_template_part(
|
||||
'template-parts/blocks/the-file',
|
||||
null,
|
||||
array(
|
||||
'ID' => $my_post_id,
|
||||
)
|
||||
);
|
||||
|
||||
########################## WP LOOOP
|
||||
?>
|
||||
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
|
||||
<?php the_content(); ?>
|
||||
<?php endwhile; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
/* -----------------------------------------------------------
|
||||
QUERIES
|
||||
-----------------------------------------------------------*/
|
||||
|
||||
<?php
|
||||
// ##### Query 🡒 Classic Query
|
||||
|
||||
$args = array('posts_per_page' => 6, 'post_type' => 'post');
|
||||
$the_query = new WP_Query($args);
|
||||
?>
|
||||
|
||||
|
||||
if ($the_query->have_posts()) {
|
||||
echo '<ul>';
|
||||
while ($the_query->have_posts()) {
|
||||
$the_query->the_post();
|
||||
echo '<li>' . get_the_title() . '</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
} else {
|
||||
// no posts found
|
||||
}
|
||||
/* Restore original Post Data */
|
||||
wp_reset_postdata();
|
||||
|
||||
|
||||
// ##### Query 🡒 Get posts
|
||||
|
||||
$args = array(
|
||||
'fields' => 'ids',
|
||||
'post_type' => 'restaurants',
|
||||
'posts_per_page' => -1
|
||||
|
||||
);
|
||||
$posts = get_posts($args);
|
||||
|
||||
|
||||
// ##### Query 🡒 Recent posts
|
||||
|
||||
$posts = wp_get_recent_posts([
|
||||
'numberposts' => 4,
|
||||
'post_status' => 'publish'
|
||||
]);
|
||||
|
||||
|
||||
// ##### Query 🡒 With Metaqueries
|
||||
$args = array(
|
||||
'post_type' => 'activities',
|
||||
'post_status' => array('publish', 'future'),
|
||||
'numberposts' => '3',
|
||||
'meta_key' => 'date',
|
||||
'orderby' => 'meta_value',
|
||||
'order' => 'ASC',
|
||||
// ######## Main
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => 'date',
|
||||
'value' => $today,
|
||||
'compare' => '>='
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$recent_activites = wp_get_recent_posts($args);
|
||||
|
||||
|
||||
/* -----------------------------------------------------------
|
||||
POST DATES
|
||||
-----------------------------------------------------------*/
|
||||
|
||||
$post_date = date_i18n('j F Y', strtotime($post['post_date']));
|
||||
|
||||
|
||||
/* -----------------------------------------------------------
|
||||
URL
|
||||
-----------------------------------------------------------*/
|
||||
|
||||
// ##### URL 🡒 Home Url
|
||||
echo home_url('/admission/');
|
||||
|
||||
// ##### URL 🡒 Site Url
|
||||
echo site_url('/admission/', 'https');
|
||||
|
||||
|
||||
/* -----------------------------------------------------------
|
||||
ENABLE SVG
|
||||
-----------------------------------------------------------*/
|
||||
|
||||
/* <?xml version="1.0" encoding="utf-8"?> */
|
||||
|
||||
function cc_mime_types($mimes)
|
||||
{
|
||||
$mimes['svg'] = 'image/svg+xml';
|
||||
return $mimes;
|
||||
}
|
||||
add_filter('upload_mimes', 'cc_mime_types');
|
||||
|
||||
|
||||
/* -----------------------------------------------------------
|
||||
INIT WIDGET
|
||||
-----------------------------------------------------------*/
|
||||
|
||||
function tailwind_widgets_init()
|
||||
{
|
||||
register_sidebar(
|
||||
array(
|
||||
'name' => esc_html__('Discover_next', 'tailwind'),
|
||||
'id' => 'discover_next',
|
||||
'description' => esc_html__('Add widgets here.', 'tailwind'),
|
||||
'before_widget' => '<section id="%1$s" class="widget %2$s">',
|
||||
'after_widget' => '</section>',
|
||||
'before_title' => '<h2 class="widget-title">',
|
||||
'after_title' => '</h2>',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/* -----------------------------------------------------------
|
||||
POSTS
|
||||
-----------------------------------------------------------*/
|
||||
|
||||
// Change Defaults Posts to "News" in menu bar
|
||||
function cp_change_post_object()
|
||||
{
|
||||
$get_post_type = get_post_type_object('post');
|
||||
|
||||
$labels = $get_post_type->labels;
|
||||
$labels->name = 'News';
|
||||
$labels->singular_name = 'News';
|
||||
$labels->add_new = 'Add News';
|
||||
$labels->add_new_item = 'Add News';
|
||||
$labels->edit_item = 'Edit News';
|
||||
$labels->new_item = 'News';
|
||||
$labels->view_item = 'View News';
|
||||
$labels->search_items = 'Search News';
|
||||
$labels->not_found = 'No News found';
|
||||
$labels->not_found_in_trash = 'No News found in Trash';
|
||||
$labels->all_items = 'All News';
|
||||
$labels->menu_name = 'News';
|
||||
$labels->name_admin_bar = 'News';
|
||||
}
|
||||
add_action('init', 'cp_change_post_object');
|
||||
|
||||
|
||||
// Change Defaults Posts Icon in menu bar
|
||||
|
||||
function change_menu_icon()
|
||||
{
|
||||
|
||||
// Access global variables.
|
||||
global $menu;
|
||||
|
||||
foreach ($menu as $key => $val) {
|
||||
|
||||
if (__('News', 'plugin-name') == $val[0]) {
|
||||
$menu[$key][6] = 'dashicons-welcome-widgets-menus';
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action('admin_menu', 'change_menu_icon');
|
||||
|
||||
/* -----------------------------------------------------------
|
||||
HIDE EDITOR ON SPECIFIC PAGE
|
||||
-----------------------------------------------------------*/
|
||||
|
||||
function remove_editor_init()
|
||||
{
|
||||
if (isset($_GET['post'])) {
|
||||
$id = $_GET['post'];
|
||||
if ($id == 7) {
|
||||
remove_post_type_support('page', 'editor');
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action('init', 'remove_editor_init');
|
||||
|
||||
/* -----------------------------------------------------------
|
||||
METABOX
|
||||
-----------------------------------------------------------*/
|
||||
|
||||
// ###### REGISTER METABOX — SPECTACLES DATE DE CREA ######
|
||||
function add_spectacles_metabox()
|
||||
{
|
||||
$screens = ['spectacles'];
|
||||
foreach ($screens as $screen) {
|
||||
add_meta_box(
|
||||
'add_spectacles_creationdate_metabox', // Unique ID
|
||||
'Création', // Box title
|
||||
'spectacles_custom_metabox_html', // Content callback, must be of type callable
|
||||
$screen, // Post type
|
||||
'side' // 'side' pour le coté, 'normal' ou rien pour en side
|
||||
);
|
||||
}
|
||||
}
|
||||
add_action('add_meta_boxes', 'add_spectacles_metabox');
|
||||
|
||||
|
||||
// ###### METABOX CONTENT DESCRIPTION — SPECTACLES CREATION ######
|
||||
function spectacles_custom_metabox_html($post)
|
||||
{
|
||||
$date_creation = get_post_meta($post->ID, '_date_crea_field', true);
|
||||
$encreation = get_post_meta($post->ID, '_encreation_field', true);
|
||||
?>
|
||||
<label for="date_crea_field"><b>Date de création</b></label>
|
||||
<input name="date_crea_field" type="number" id="date_crea_field" value="<?php echo $date_creation ?>">
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<div>
|
||||
<p><b>Le spectacle est en cours de création ?</b></p>
|
||||
<input type="checkbox" id="encreation_field" name="encreation_field" <?php echo $encreation ? 'checked' : '' ?>>
|
||||
<label for="encreation_field">Yes ! C'est en cours de création 🔥 </label>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
// ###### METABOX HANDLE SAVE — SPECTACLES DATE DE CREA ######
|
||||
function date_crea_save_postdata($post_id)
|
||||
{
|
||||
if (array_key_exists('date_crea_field', $_POST)) {
|
||||
update_post_meta(
|
||||
$post_id,
|
||||
'_date_crea_field',
|
||||
$_POST['date_crea_field']
|
||||
);
|
||||
update_post_meta(
|
||||
$post_id,
|
||||
'_encreation_field',
|
||||
$_POST['encreation_field']
|
||||
);
|
||||
}
|
||||
}
|
||||
add_action('save_post', 'date_crea_save_postdata');
|
||||
30
includes/taxonomy.php
Normal file
30
includes/taxonomy.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
function add_custom_taxonomies() {
|
||||
register_taxonomy('thematiques', 'post', array(
|
||||
|
||||
// 'hierarchical' => true,
|
||||
|
||||
// This array of options controls the labels displayed in the WordPress Admin UI
|
||||
'labels' => array(
|
||||
'name' => _x( 'Thématiques', 'taxonomy general name' ),
|
||||
'singular_name' => _x( 'Thématique', 'taxonomy singular name' ),
|
||||
'search_items' => __( 'Chercher une Thématique' ),
|
||||
'all_items' => __( 'Toutes les Thématiques' ),
|
||||
'parent_item' => __( 'Thématique Parent' ),
|
||||
'parent_item_colon' => __( 'Thématique Parent:' ),
|
||||
'edit_item' => __( 'Editer la Thématique' ),
|
||||
'update_item' => __( 'Mettre à jour la Thématique' ),
|
||||
'add_new_item' => __( 'Ajouter une Thématique' ),
|
||||
'new_item_name' => __( 'Nom de la nouvelle Thématique' ),
|
||||
'menu_name' => __( 'Thématiques' ),
|
||||
),
|
||||
// Control the slugs used for this taxonomy
|
||||
'rewrite' => array(
|
||||
'slug' => 'thematiques', // This controls the base slug that will display before each term
|
||||
// 'with_front' => false, // Don't display the category base before "/locations/"
|
||||
'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/"
|
||||
),
|
||||
));
|
||||
}
|
||||
add_action( 'init', 'add_custom_taxonomies', 0 );
|
||||
13
includes/widget.php
Normal file
13
includes/widget.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
register_sidebar(
|
||||
array(
|
||||
'name' => 'Experts',
|
||||
'id' => 'widget_nos_experts',
|
||||
'description' => 'Add widgets here.',
|
||||
// 'before_widget' => '<section id="%1$s" class="widget %2$s">',
|
||||
// 'after_widget' => '</section>',
|
||||
// 'before_title' => '<h2 class="widget-title">',
|
||||
// 'after_title' => '</h2>',
|
||||
),
|
||||
);
|
||||
20
index.php
Normal file
20
index.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php get_header(); ?>
|
||||
|
||||
<div class="container mx-auto my-8">
|
||||
|
||||
<?php if ( have_posts() ) : ?>
|
||||
<?php
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
?>
|
||||
|
||||
<?php get_template_part( 'template-parts/content', get_post_format() ); ?>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
get_footer();
|
||||
57
init_script.sh
Normal file
57
init_script.sh
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# ——— PROJECT NAME ———
|
||||
echo "——${RED} Quel est le nom du client ?${NC} "
|
||||
read clientName
|
||||
projectName="Deligraph_${clientName}"
|
||||
|
||||
|
||||
# ——— RECONFIGURATION DE L'URL HOME LOCALE ———
|
||||
echo "##### ${GREEN}RECONFIGURATION DE L'URL HOME LOCALE${NC} ##### "
|
||||
# Manually change my db host sur ma machine pour wp-cli fonctionne en local (pour bien préciser le socket)
|
||||
# define('DB_HOST', 'localhost:/Users/martoni_sato/Library/Application Support/Local/run/nFQk01MlZ/mysql/mysqld.sock');
|
||||
|
||||
# ——— PLUGINS ———
|
||||
echo "##### ${GREEN}INSTALLATION DES PLUGINS ${NC} #####"
|
||||
wp plugin install ./wp-database-tools-main.zip --activate
|
||||
wp plugin install duplicator --activate
|
||||
wp plugin install advanced-custom-fields-pro --activate
|
||||
|
||||
composer require wpengine/advanced-custom-fields-pro
|
||||
wp plugin activate advanced-custom-fields-pro
|
||||
wp eval 'acf_pro_update_license("b3JkZXJfaWQ9NTg3Nzd8dHlwZT1kZXZlbG9wZXJ8ZGF0ZT0yMDE1LTA2LTI1IDA4OjE5OjUx");'
|
||||
|
||||
# ——— LANGUE ———
|
||||
wp language core install fr_FR
|
||||
wp language core activate fr_FR
|
||||
|
||||
|
||||
# ——— THEME ———
|
||||
echo "##### ${GREEN}INSTALLATION DU THEME ${NC} #####"
|
||||
git clone https://gitlab.com/deligraph/wp_starter.git
|
||||
mv wp_starter $projectName
|
||||
cd $projectName
|
||||
sed -i "s/Deligraph_theme/$projectName/g" style.css
|
||||
wp theme activate projectName
|
||||
|
||||
# ——— DEFAULT CONTENT ———
|
||||
wp post create --post_type=page --post_title='Home' --post_status='publish'
|
||||
wp post create --post_type=page --post_title='News' --post_status='publish'
|
||||
|
||||
wp option update show_on_front "page"
|
||||
wp option update page_on_front "4"
|
||||
# wp option update page_for_posts "5"
|
||||
|
||||
|
||||
# ——— DESCATIVER LES COMMENTAIREs———
|
||||
|
||||
# make all comments disabled
|
||||
wp option update disable_comments_options --format=json '{"disabled_post_types":["post","page","attachment"],"remove_everywhere":true,"permanent":false,"extra_post_types":false,"db_version":6}'
|
||||
|
||||
|
||||
|
||||
wp menu create "Main Menu"
|
||||
wp menu location assign main-menu primary
|
||||
5710
package-lock.json
generated
Normal file
5710
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
49
package.json
Normal file
49
package.json
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"name": "tailpress",
|
||||
"version": "3.0.0",
|
||||
"description": "Boilerplate WordPress theme with Tailwind CSS.",
|
||||
"author": "Jeffrey van Rossum",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jeffreyvr/tailpress"
|
||||
},
|
||||
"theme_uri": "https://github.com/jeffreyvr/tailpress",
|
||||
"author_uri": "https://vanrossum.dev",
|
||||
"text_domain": "tailpress",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"production:css-app": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/app.css -o ./css/app.css --postcss --minify",
|
||||
"production:css-editor": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/editor-style.css -o ./css/editor-style.css --postcss --minify",
|
||||
"production:css-admin": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/admin-style.css -o ./css/admin-style.css --postcss --minify",
|
||||
"production:css-login": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/login-style.css -o ./css/login-style.css --postcss --minify",
|
||||
"production:js": "cross-env NODE_ENV=development ./node_modules/.bin/esbuild ./resources/js/app.js --bundle --outfile=./js/app.js --minify",
|
||||
"dev:css-app": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/app.css -o ./css/app.css --postcss",
|
||||
"dev:css-editor": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/editor-style.css -o ./css/editor-style.css --postcss",
|
||||
"dev:css-admin": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/admin-style.css -o ./css/admin-style.css --postcss",
|
||||
"dev:css-login": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/login-style.css -o ./css/login-style.css --postcss",
|
||||
"dev:js": "cross-env NODE_ENV=development ./node_modules/.bin/esbuild ./resources/js/app.js --bundle --outfile=./js/app.js",
|
||||
"watch:css-app": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/app.css -o ./css/app.css --postcss --watch",
|
||||
"watch:css-editor": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/editor-style.css -o ./css/editor-style.css --postcss --watch",
|
||||
"watch:css-admin": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/admin-style.css -o ./css/admin-style.css --postcss --watch",
|
||||
"watch:css-login": "cross-env NODE_ENV=development tailwindcss -i ./resources/css/login-style.css -o ./css/login-style.css --postcss --watch",
|
||||
"watch:js": "cross-env NODE_ENV=development ./node_modules/.bin/esbuild ./resources/js/app.js --bundle --outfile=./js/app.js --watch",
|
||||
"production": "cross-env NODE_ENV=production concurrently \"npm run production:css-app\" \"npm run production:css-editor\" \"npm run production:css-admin\" \"npm run production:css-login\" \"npm run production:js\"",
|
||||
"dev": "cross-env NODE_ENV=development concurrently \"npm run dev:css-app\" \"npm run dev:css-admin\" \"npm run dev:css-editor\" \"npm run dev:css-login\" \"npm run dev:js\"",
|
||||
"watch": "cross-env NODE_ENV=development concurrently \"npm run watch:css-app\" \"npm run watch:css-editor\" \"npm run watch:css-admin\" \"npm run watch:css-login\" \"npm run watch:js\"",
|
||||
"browser-sync": "cross-env NODE_ENV=development browser-sync start --proxy \"tailpress.test\" --host=\"tailpress.test\" --no-inject-changes --files=\"./\"",
|
||||
"watch-sync": "cross-env NODE_ENV=development concurrently \"npm run browser-sync\" \"npm run watch\""
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jeffreyvr/tailwindcss-tailpress": "^2.0.0",
|
||||
"autoprefixer": "^10.4.0",
|
||||
"browser-sync": "^2.26.14",
|
||||
"concurrently": "^6.2.1",
|
||||
"cross-env": "^6.0.3",
|
||||
"esbuild": "^0.12.24",
|
||||
"postcss": "^8.4.4",
|
||||
"postcss-import": "^14.0.0",
|
||||
"postcss-nested-ancestors": "^2.0.0",
|
||||
"resolve-url-loader": "^3.1.2",
|
||||
"tailwindcss": "^3.1.0"
|
||||
}
|
||||
}
|
||||
16
page.php
Normal file
16
page.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php get_header(); ?>
|
||||
|
||||
|
||||
<?php if (have_posts()) : ?>
|
||||
<?php
|
||||
while (have_posts()) :
|
||||
the_post();
|
||||
the_content();
|
||||
?>
|
||||
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php get_footer();
|
||||
8
postcss.config.js
Normal file
8
postcss.config.js
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
module.exports = {
|
||||
plugins: [
|
||||
require('postcss-nested-ancestors'),
|
||||
require('postcss-import'),
|
||||
require('tailwindcss/nesting'),
|
||||
require('tailwindcss')
|
||||
]
|
||||
}
|
||||
6
resources/css/admin-style.css
Normal file
6
resources/css/admin-style.css
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
/* body {
|
||||
background: red !important;
|
||||
} */
|
||||
#menu-posts {
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
|
||||
}
|
||||
22
resources/css/app.css
Normal file
22
resources/css/app.css
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
@import 'tailwindcss/base';
|
||||
@import 'tailwindcss/components';
|
||||
@import 'tailwindcss/utilities';
|
||||
|
||||
@import 'custom.css';
|
||||
|
||||
/* ########### BASE ############ */
|
||||
@import './base/typography.css';
|
||||
|
||||
/* ########### COMPONENTS ############ */
|
||||
@import './components/cta.css';
|
||||
|
||||
/* ########### LAYOUT ############ */
|
||||
@import './layout/nav.css';
|
||||
@import './layout/footer.css';
|
||||
@import './layout/section.css';
|
||||
@import './layout/gutenberg.css';
|
||||
|
||||
/* ########### BLOCKS ############ */
|
||||
|
||||
/* Home */
|
||||
@import '../../template-blocks/home/home-header/home-header.css';
|
||||
0
resources/css/base/typography.css
Normal file
0
resources/css/base/typography.css
Normal file
0
resources/css/components/cta.css
Normal file
0
resources/css/components/cta.css
Normal file
0
resources/css/custom.css
Normal file
0
resources/css/custom.css
Normal file
28
resources/css/editor-style.css
Normal file
28
resources/css/editor-style.css
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
@import "tailwindcss/components";
|
||||
@import "tailwindcss/utilities";
|
||||
|
||||
body {
|
||||
@apply font-sans;
|
||||
}
|
||||
|
||||
.wp-block {
|
||||
@apply max-w-screen-xl;
|
||||
}
|
||||
|
||||
.wp-block[data-align="wide"] {
|
||||
@apply max-w-screen-xl;
|
||||
}
|
||||
|
||||
.wp-block[data-align="full"] {
|
||||
@apply max-w-full;
|
||||
}
|
||||
.wp-block.alignfull {
|
||||
@apply max-w-full;
|
||||
}
|
||||
|
||||
.acf-block-component {
|
||||
/* @apply bg-red-500; */
|
||||
}
|
||||
.acf-block-fields {
|
||||
@apply max-w-screen-md mx-auto;
|
||||
}
|
||||
0
resources/css/layout/footer.css
Normal file
0
resources/css/layout/footer.css
Normal file
45
resources/css/layout/gutenberg.css
Normal file
45
resources/css/layout/gutenberg.css
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
article > *:not(.entry-content),
|
||||
.entry-content > * {
|
||||
@apply mx-auto max-w-content;
|
||||
}
|
||||
|
||||
.entry-content,
|
||||
.block-editor-block-list__layout {
|
||||
h1 {
|
||||
@apply text-2xl;
|
||||
}
|
||||
|
||||
h2 {
|
||||
@apply text-xl;
|
||||
}
|
||||
|
||||
h3 {
|
||||
@apply text-lg;
|
||||
}
|
||||
|
||||
p,
|
||||
ul,
|
||||
ol {
|
||||
a {
|
||||
@apply text-blue-500 underline;
|
||||
|
||||
&:hover {
|
||||
@apply no-underline;
|
||||
}
|
||||
}
|
||||
|
||||
@apply mb-8;
|
||||
}
|
||||
|
||||
ul:not(.block-editor-block-variation-picker__variations) {
|
||||
li {
|
||||
@apply list-disc list-inside;
|
||||
}
|
||||
}
|
||||
|
||||
ol {
|
||||
li {
|
||||
@apply list-decimal list-inside;
|
||||
}
|
||||
}
|
||||
}
|
||||
265
resources/css/layout/nav.css
Normal file
265
resources/css/layout/nav.css
Normal file
|
|
@ -0,0 +1,265 @@
|
|||
.primary-menu-container {
|
||||
@apply mx-auto
|
||||
bg-primary
|
||||
text-white
|
||||
relative
|
||||
h-fit
|
||||
py-8
|
||||
px-8
|
||||
2xl:px-32
|
||||
my-0;
|
||||
|
||||
nav#primary-menu-nav {
|
||||
@apply max-w-screen-2xl w-full mx-auto;
|
||||
}
|
||||
.logo {
|
||||
@apply mr-12
|
||||
w-[190px]
|
||||
xl:w-[222px];
|
||||
}
|
||||
#primary-menu {
|
||||
@apply flex
|
||||
flex-col
|
||||
lg:flex-row
|
||||
items-center
|
||||
justify-around
|
||||
lg:justify-between;
|
||||
|
||||
ul {
|
||||
@apply lg:flex
|
||||
gap-x-2
|
||||
lg:gap-x-4
|
||||
xl:gap-x-8
|
||||
pr-0
|
||||
lg:pr-4
|
||||
xl:pr-24;
|
||||
}
|
||||
|
||||
/* Highlight using list element */
|
||||
li.current-page-parent > a,
|
||||
li.current_page_item > a {
|
||||
@apply font-medium
|
||||
text-white
|
||||
decoration-secondary
|
||||
underline
|
||||
underline-offset-8;
|
||||
}
|
||||
|
||||
li.menu-item {
|
||||
@apply font-medium
|
||||
text-sm
|
||||
text-center;
|
||||
|
||||
&:hover > a,
|
||||
a:focus {
|
||||
@apply cursor-pointer
|
||||
underline
|
||||
underline-offset-8
|
||||
text-secondary;
|
||||
}
|
||||
a:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* IF SUBMENU CHILD */
|
||||
.menu-item-submenu-toggle {
|
||||
&:hover,
|
||||
&:focus {
|
||||
@apply text-secondary;
|
||||
}
|
||||
@apply relative pr-4;
|
||||
&:after {
|
||||
@apply absolute right-0;
|
||||
content: '▼';
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
line-height: 0.5;
|
||||
height: 10px;
|
||||
top: calc(50% - 4px);
|
||||
width: 10px;
|
||||
margin-left: 20px;
|
||||
transform-origin: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
}
|
||||
.menu-item-submenu-toggle[aria-expanded='false']:after {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
.menu-item-submenu-toggle[aria-expanded='true']:after {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
li.menu-item.menu-item-has-children:hover {
|
||||
@screen lg {
|
||||
.menu-item-submenu-toggle:after {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
.sub-menu {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* submenus */
|
||||
li .sub-menu {
|
||||
@apply bg-primary
|
||||
p-6
|
||||
mx-auto
|
||||
lg:mx-0
|
||||
static
|
||||
lg:absolute;
|
||||
z-index: 999;
|
||||
display: none;
|
||||
|
||||
&.sub-menu-open {
|
||||
display: block;
|
||||
}
|
||||
|
||||
li {
|
||||
@apply py-2 lg:text-left;
|
||||
}
|
||||
|
||||
> a::after {
|
||||
transform: translateY(-2px) rotate(-90deg);
|
||||
content: '';
|
||||
display: inline-block;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
margin-left: 20px;
|
||||
background-image: url('../resources/img/arrow_down_white.svg');
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
button#burger-menu-toggle {
|
||||
@apply lg:hidden
|
||||
absolute
|
||||
right-10
|
||||
-translate-y-1/2
|
||||
z-50
|
||||
top-1/2;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
|
||||
.menu-toggle-bar {
|
||||
@apply top-1/2
|
||||
absolute
|
||||
block
|
||||
right-0
|
||||
w-full
|
||||
h-[2px]
|
||||
/* bg-red-400 */
|
||||
bg-white;
|
||||
margin-top: -1px;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&.menu-toggle-bar--top {
|
||||
transform: translate(0, -7px);
|
||||
}
|
||||
&.menu-toggle-bar--middle {
|
||||
}
|
||||
&.menu-toggle-bar--bottom {
|
||||
transform: translate(0, 7px);
|
||||
}
|
||||
.nav-open & {
|
||||
@apply bg-secondary;
|
||||
|
||||
&.menu-toggle-bar--top {
|
||||
transform: translate(0, 0) rotate(45deg);
|
||||
}
|
||||
&.menu-toggle-bar--middle {
|
||||
opacity: 0;
|
||||
}
|
||||
&.menu-toggle-bar--bottom {
|
||||
transform: translate(0, 0) rotate(-45deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
path {
|
||||
@apply fill-secondary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* RESPONSIVE */
|
||||
@media (max-width: 960px) {
|
||||
.primary-menu-container {
|
||||
#primary-menu {
|
||||
@apply bg-primary
|
||||
mt-0
|
||||
left-0
|
||||
z-40
|
||||
absolute
|
||||
hidden;
|
||||
|
||||
/* transition: all 0.3s ease-out;
|
||||
transform: translateY(-120vh); */
|
||||
min-height: 100vh;
|
||||
height: fit-content;
|
||||
top: 0;
|
||||
width: 100vw;
|
||||
|
||||
/* Rendu conditionnel de l'élément si contenu dans une classe de parent (nesting inversé) */
|
||||
|
||||
.nav-open & {
|
||||
@apply flex;
|
||||
}
|
||||
|
||||
> ul {
|
||||
@apply max-w-xs
|
||||
mx-auto;
|
||||
/* min-height: 96vh; */
|
||||
padding-top: 5vh;
|
||||
}
|
||||
li.menu-item {
|
||||
@apply mt-0
|
||||
text-center
|
||||
text-white
|
||||
font-medium
|
||||
py-8
|
||||
text-lg
|
||||
!block
|
||||
pb-0;
|
||||
|
||||
.sub-menu li {
|
||||
@apply text-sm;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* BURGER MENU */
|
||||
body:has(.nav-open) {
|
||||
@apply max-h-screen
|
||||
overflow-hidden;
|
||||
|
||||
/* #content,
|
||||
footer,
|
||||
.wpml-ls-statics-footer {
|
||||
@apply !hidden;
|
||||
} */
|
||||
}
|
||||
|
||||
.cta_plain_secondary,
|
||||
.switch_language {
|
||||
/* @apply self-end; */
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 960px) and (hover: none) {
|
||||
/* ul {
|
||||
@apply w-max mx-auto;
|
||||
} */
|
||||
.primary-menu-container {
|
||||
li.menu-item {
|
||||
@apply mx-auto
|
||||
/* !text-left */;
|
||||
}
|
||||
}
|
||||
}
|
||||
0
resources/css/layout/section.css
Normal file
0
resources/css/layout/section.css
Normal file
30
resources/css/login-style.css
Normal file
30
resources/css/login-style.css
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
body {
|
||||
/* @apply bg-primary; */
|
||||
}
|
||||
|
||||
#login h1 a,
|
||||
.login h1 a {
|
||||
background-image: url("../resources/img/logo_client.svg");
|
||||
height: 100px;
|
||||
width: 300px;
|
||||
background-size: 300px 100px;
|
||||
background-repeat: no-repeat;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
#wp-submit {
|
||||
@apply bg-primary border-primary;
|
||||
}
|
||||
#nav a,
|
||||
#backtoblog a {
|
||||
/* color: var(--red) !important; */
|
||||
@apply text-primary;
|
||||
}
|
||||
|
||||
#loginform {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.wp-pwd span {
|
||||
@apply text-primary;
|
||||
/* color: var(--red) !important; */
|
||||
}
|
||||
3
resources/img/arrow_down_white.svg
Normal file
3
resources/img/arrow_down_white.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="60.566" height="60.012" viewBox="0 0 60.566 60.012">
|
||||
<path id="Tracé_766" data-name="Tracé 766" d="M0,0,30.42,60.012,60.566,0Z" transform="translate(0 0)" fill="#fff"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 227 B |
3
resources/img/arrow_right_white.svg
Normal file
3
resources/img/arrow_right_white.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="14.52" height="27.04" viewBox="0 0 14.52 27.04">
|
||||
<path id="Tracé_139" data-name="Tracé 139" d="M24.565.354,12.459,12.46.354.354" transform="translate(1.061 25.979) rotate(-90)" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 327 B |
6
resources/img/close_menu_icon.svg
Normal file
6
resources/img/close_menu_icon.svg
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="329.871" height="329.87" viewBox="0 0 329.871 329.87">
|
||||
<g id="Groupe_784" data-name="Groupe 784" transform="translate(19045.936 1289.935)">
|
||||
<line id="Ligne_43" data-name="Ligne 43" y1="303" x2="303" transform="translate(-19032.5 -1276.5)" fill="none" stroke="#fff" stroke-linecap="round" stroke-width="19"/>
|
||||
<line id="Ligne_44" data-name="Ligne 44" x1="303" y1="303" transform="translate(-19032.5 -1276.5)" fill="none" stroke="#fff" stroke-linecap="round" stroke-width="19"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 547 B |
6
resources/js/app.js
Normal file
6
resources/js/app.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import menuInit from './header';
|
||||
console.log('menuInit');
|
||||
console.log('menuIniteeeee');
|
||||
window.addEventListener('load', function () {
|
||||
menuInit();
|
||||
});
|
||||
62
resources/js/header.js
Normal file
62
resources/js/header.js
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
export default function menuInit() {
|
||||
let main_navigation =
|
||||
document.querySelector('#primary-menu');
|
||||
const header = document.querySelector('#primary-header');
|
||||
const primary_menu =
|
||||
header.querySelector('#primary-menu');
|
||||
const burgerMenuToggle = header.querySelector(
|
||||
'#burger-menu-toggle'
|
||||
);
|
||||
const submenuToggles = primary_menu.querySelectorAll(
|
||||
'.menu-item-submenu-toggle'
|
||||
);
|
||||
|
||||
// #### Open/close burger nav
|
||||
burgerMenuToggle.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
header.classList.toggle('nav-open');
|
||||
burgerMenuToggle.toggleAttribute('aria-expanded');
|
||||
gsap.from(primary_menu, {
|
||||
opacity: 20,
|
||||
y: '-100vh',
|
||||
duration: 0.5,
|
||||
ease: Power4.easeOut,
|
||||
});
|
||||
});
|
||||
|
||||
// #### Close nav when reaching the end of the menu with tab
|
||||
document.addEventListener(
|
||||
'focusin',
|
||||
(e) => {
|
||||
const header = document.querySelector(
|
||||
'#primary-header'
|
||||
);
|
||||
console.log(header.contains(document.activeElement));
|
||||
if (
|
||||
header.classList.contains('nav-open') &&
|
||||
!header.contains(document.activeElement)
|
||||
) {
|
||||
header.classList.remove('nav-open');
|
||||
burgerMenuToggle.setAttribute(
|
||||
'aria-expanded',
|
||||
false
|
||||
);
|
||||
|
||||
burgerMenuToggle.focus();
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
|
||||
submenuToggles.forEach((button) => {
|
||||
button.addEventListener('click', function (e) {
|
||||
let isExpanded =
|
||||
button.getAttribute('aria-expanded') === 'true';
|
||||
button.setAttribute('aria-expanded', !isExpanded);
|
||||
|
||||
button.parentElement
|
||||
.querySelector('.sub-menu')
|
||||
.classList.toggle('sub-menu-open');
|
||||
});
|
||||
});
|
||||
}
|
||||
8
safelist.txt
Normal file
8
safelist.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
alignfull
|
||||
alignwide
|
||||
alignnone
|
||||
aligncenter
|
||||
alignright
|
||||
wp-block-button
|
||||
wp-caption
|
||||
wp-caption-text
|
||||
BIN
screenshot.png
Normal file
BIN
screenshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 682 KiB |
28
single.php
Normal file
28
single.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php get_header(); ?>
|
||||
|
||||
<div class="container my-8 mx-auto">
|
||||
|
||||
<?php if ( have_posts() ) : ?>
|
||||
|
||||
<?php
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
?>
|
||||
|
||||
<?php get_template_part( 'template-parts/content', 'single' ); ?>
|
||||
|
||||
<?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;
|
||||
?>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
get_footer();
|
||||
37
style-login.css
Normal file
37
style-login.css
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
:root {
|
||||
--red: #df1e1e;
|
||||
}
|
||||
body {
|
||||
background: white;
|
||||
}
|
||||
#loginform {
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
||||
border-radius: 10px;
|
||||
padding: 30px;
|
||||
}
|
||||
#login h1 a,
|
||||
.login h1 a {
|
||||
/* background-image: url('./resources/img/logos/homegrade-logo-complet.svg'); */
|
||||
height: 100px;
|
||||
width: 300px;
|
||||
background-size: 300px 100px;
|
||||
background-repeat: no-repeat;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
#wp-submit {
|
||||
background-color: var(--red) !important;
|
||||
border-color: var(--red) !important;
|
||||
}
|
||||
#nav a,
|
||||
#backtoblog a {
|
||||
/* color: var(--red) !important; */
|
||||
/* color: white !important; */
|
||||
}
|
||||
|
||||
#loginform {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.wp-pwd span {
|
||||
color: var(--red) !important;
|
||||
}
|
||||
7
style.css
Normal file
7
style.css
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
Theme Name: Deligraph_starter
|
||||
Author: Deligraph
|
||||
Author URI: https://deligraph.com/
|
||||
Version: 1.0.0
|
||||
|
||||
*/
|
||||
36
tailwind.config.js
Normal file
36
tailwind.config.js
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
const theme = require('./theme.json');
|
||||
const tailpress = require("@jeffreyvr/tailwindcss-tailpress");
|
||||
|
||||
module.exports = {
|
||||
content: [
|
||||
'./*.php',
|
||||
'./**/*.php',
|
||||
'./resources/css/*.css',
|
||||
'./resources/js/*.js',
|
||||
'./safelist.txt'
|
||||
],
|
||||
theme: {
|
||||
container: {
|
||||
padding: {
|
||||
DEFAULT: '1rem',
|
||||
sm: '2rem',
|
||||
lg: '0rem'
|
||||
},
|
||||
},
|
||||
extend: {
|
||||
colors: tailpress.colorMapper(tailpress.theme('settings.color.palette', theme)),
|
||||
fontSize: tailpress.fontSizeMapper(tailpress.theme('settings.typography.fontSizes', theme))
|
||||
},
|
||||
screens: {
|
||||
'xs': '480px',
|
||||
'sm': '600px',
|
||||
'md': '782px',
|
||||
'lg': tailpress.theme('settings.layout.contentSize', theme),
|
||||
'xl': tailpress.theme('settings.layout.wideSize', theme),
|
||||
'2xl': '1440px'
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
tailpress.tailwind
|
||||
]
|
||||
};
|
||||
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>
|
||||
25
template-parts/content-single.php
Normal file
25
template-parts/content-single.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
|
||||
<header class="entry-header mb-4">
|
||||
<?php the_title( sprintf( '<h1 class="entry-title text-2xl lg:text-5xl font-extrabold leading-tight mb-1"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?>
|
||||
<time datetime="<?php echo get_the_date( 'c' ); ?>" itemprop="datePublished" class="text-sm text-gray-700"><?php echo get_the_date(); ?></time>
|
||||
</header>
|
||||
|
||||
<div class="entry-content">
|
||||
<?php the_content(); ?>
|
||||
|
||||
<?php
|
||||
wp_link_pages(
|
||||
array(
|
||||
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'tailpress' ) . '</span>',
|
||||
'after' => '</div>',
|
||||
'link_before' => '<span>',
|
||||
'link_after' => '</span>',
|
||||
'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'tailpress' ) . ' </span>%',
|
||||
'separator' => '<span class="screen-reader-text">, </span>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
|
||||
</article>
|
||||
41
template-parts/content.php
Normal file
41
template-parts/content.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<article id="post-<?php the_ID(); ?>" <?php post_class( 'mb-12' ); ?>>
|
||||
|
||||
<header class="entry-header mb-4">
|
||||
<?php the_title( sprintf( '<h2 class="entry-title text-2xl md:text-3xl font-extrabold leading-tight mb-1"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
|
||||
<time datetime="<?php echo get_the_date( 'c' ); ?>" itemprop="datePublished" class="text-sm text-gray-700"><?php echo get_the_date(); ?></time>
|
||||
</header>
|
||||
|
||||
<?php if ( is_search() || is_archive() ) : ?>
|
||||
|
||||
<div class="entry-summary">
|
||||
<?php the_excerpt(); ?>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div class="entry-content">
|
||||
<?php
|
||||
/* translators: %s: Name of current post */
|
||||
the_content(
|
||||
sprintf(
|
||||
__( 'Continue reading %s', 'tailpress' ),
|
||||
the_title( '<span class="screen-reader-text">"', '"</span>', false )
|
||||
)
|
||||
);
|
||||
|
||||
wp_link_pages(
|
||||
array(
|
||||
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'tailpress' ) . '</span>',
|
||||
'after' => '</div>',
|
||||
'link_before' => '<span>',
|
||||
'link_after' => '</span>',
|
||||
'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'tailpress' ) . ' </span>%',
|
||||
'separator' => '<span class="screen-reader-text">, </span>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</article>
|
||||
69
theme.json
Normal file
69
theme.json
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
"version": 1,
|
||||
"settings": {
|
||||
"layout": {
|
||||
"contentSize": "960px",
|
||||
"wideSize": "1280px"
|
||||
},
|
||||
"color": {
|
||||
"defaultPalette": false,
|
||||
"custom": false,
|
||||
"palette": [
|
||||
{
|
||||
"name": "Primary",
|
||||
"slug": "primary",
|
||||
"color": "#404F8E"
|
||||
},
|
||||
{
|
||||
"name": "Secondary",
|
||||
"slug": "secondary",
|
||||
"color": "#14B8A6"
|
||||
},
|
||||
{
|
||||
"name": "Dark",
|
||||
"slug": "dark",
|
||||
"color": "#1F2937"
|
||||
},
|
||||
{
|
||||
"name": "Light",
|
||||
"slug": "light",
|
||||
"color": "#F9FAFB"
|
||||
}
|
||||
]
|
||||
},
|
||||
"typography": {
|
||||
"fontSizes": [
|
||||
{
|
||||
"name": "Small",
|
||||
"slug": "small",
|
||||
"size": "0.875rem"
|
||||
},
|
||||
{
|
||||
"slug": "regular",
|
||||
"name": "Regular",
|
||||
"size": "1.5rem"
|
||||
},
|
||||
{
|
||||
"slug": "large",
|
||||
"name": "Large",
|
||||
"size": "1.125rem"
|
||||
},
|
||||
{
|
||||
"slug": "xl",
|
||||
"name": "XL",
|
||||
"size": "1.25rem"
|
||||
},
|
||||
{
|
||||
"slug": "xxl",
|
||||
"name": "2XL",
|
||||
"size": "1.5rem"
|
||||
},
|
||||
{
|
||||
"slug": "xxxl",
|
||||
"name": "3XL",
|
||||
"size": "1.875rem"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user