replugin the real starter to git and adding page.php
This commit is contained in:
parent
b138f60fc9
commit
2099113303
7
css/admin-style.css
Normal file
7
css/admin-style.css
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/* body {
|
||||
background: red !important;
|
||||
} */
|
||||
|
||||
#menu-posts {
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
|
||||
}
|
||||
|
|
@ -373,14 +373,17 @@ body {
|
|||
max-width: 1280px
|
||||
}
|
||||
|
||||
.wp-block[data-align=wide] {
|
||||
.wp-block[data-align="wide"] {
|
||||
max-width: 1280px
|
||||
}
|
||||
|
||||
.wp-block[data-align=full] {
|
||||
.wp-block[data-align="full"] {
|
||||
max-width: 100%
|
||||
}
|
||||
|
||||
.acf-block-component {
|
||||
}
|
||||
|
||||
@media (min-width: 782px) {
|
||||
.md\:my-6 {
|
||||
margin-top: 1.5rem;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ function tailpress_enqueue_scripts()
|
|||
|
||||
function enqueue_gutenberg_back_styles()
|
||||
{
|
||||
// wp_enqueue_style( 'tailpress_back', tailpress_asset( 'css/app.css' ), array() );
|
||||
wp_enqueue_style('tailpress_back', tailpress_asset('css/app.css'), array());
|
||||
}
|
||||
add_action('enqueue_block_editor_assets', 'enqueue_gutenberg_back_styles');
|
||||
|
||||
|
|
@ -131,6 +131,8 @@ add_filter('nav_menu_submenu_css_class', 'tailpress_nav_menu_add_submenu_class',
|
|||
|
||||
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/taxonomy.php');
|
||||
// require_once( __DIR__ . '/includes/errorlog.php');
|
||||
// require_once( __DIR__ . '/includes/logos.php');
|
||||
28
includes/admin.php
Normal file
28
includes/admin.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?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');
|
||||
|
|
@ -2,20 +2,21 @@
|
|||
|
||||
|
||||
// ##### Blocks Category 🡒 Déclaration de la catégorie de blocks custom
|
||||
function client_add_block_categories( $categories ) {
|
||||
function client_add_block_categories($categories)
|
||||
{
|
||||
return array_merge(
|
||||
|
||||
[
|
||||
[
|
||||
[
|
||||
'slug' => 'client_blocks',
|
||||
'title' => __( 'Mon titre ', 'client-blocks' ),
|
||||
'icon' => 'heart',
|
||||
],
|
||||
'slug' => 'client_blocks',
|
||||
'title' => __('Mon titre ', 'client-blocks'),
|
||||
'icon' => 'heart',
|
||||
],
|
||||
$categories
|
||||
],
|
||||
$categories
|
||||
);
|
||||
}
|
||||
add_action( 'block_categories_all', 'client_add_block_categories', 10, 2 );
|
||||
add_action('block_categories_all', 'client_add_block_categories', 10, 2);
|
||||
|
||||
|
||||
// ##### Blocks 🡒 Déclaration des blocks acf custom
|
||||
|
|
@ -29,7 +30,7 @@ function acf_custom_client_blocks_init()
|
|||
'name' => 'home_header',
|
||||
'title' => __("Home — Section d'accueil"),
|
||||
'description' => __("Brique pour la section d'acccueil"),
|
||||
'render_template' => 'template-parts/blocks/home/home_header/home_header.php',
|
||||
'render_template' => 'template-blocks/home/home_header/home_header.php',
|
||||
'category' => 'client_blocks',
|
||||
'multiple' => false,
|
||||
'mode' => 'auto',
|
||||
|
|
@ -51,9 +52,9 @@ function acf_custom_client_blocks_init()
|
|||
// ##### Home 🡒 Latest Articles
|
||||
acf_register_block_type(array(
|
||||
'name' => 'latest_articles',
|
||||
'title' => __("Home — Derniers Articles"),
|
||||
'title' => __("Derniers Articles"),
|
||||
'description' => __("Brique pour afficher les derniers articles publiés sur le site"),
|
||||
'render_template' => 'template-parts/blocks/home/latest_articles/latest_articles.php',
|
||||
'render_template' => 'template-blocks/generics/latest-post-query.php',
|
||||
'category' => 'client_blocks',
|
||||
'multiple' => false,
|
||||
'mode' => 'auto',
|
||||
|
|
@ -66,7 +67,6 @@ function acf_custom_client_blocks_init()
|
|||
// },
|
||||
|
||||
));
|
||||
|
||||
}
|
||||
}
|
||||
add_action('acf/init', 'acf_custom_client_blocks_init');
|
||||
|
|
@ -79,7 +79,3 @@ add_action('acf/init', 'acf_custom_client_blocks_init');
|
|||
// add_editor_style( get_stylesheet_directory_uri() . '/template-parts/blocks/editor.css' );
|
||||
// }
|
||||
// add_action( 'admin_init', 'block_newsfeed_add_editor_styles' );
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,20 +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');
|
||||
// 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');
|
||||
// // 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');
|
||||
|
|
@ -1,12 +1,5 @@
|
|||
<?php
|
||||
|
||||
// Removing Articles from the admin bar
|
||||
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' );
|
||||
|
||||
|
||||
|
||||
// #### POST TYPES
|
||||
|
|
@ -34,4 +27,3 @@ function create_posttype() {
|
|||
|
||||
}
|
||||
add_action( 'init', 'create_posttype' );
|
||||
|
||||
|
|
|
|||
|
|
@ -14,16 +14,19 @@
|
|||
"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: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: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: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:js\"",
|
||||
"dev": "cross-env NODE_ENV=development concurrently \"npm run dev:css-app\" \"npm run dev:css-editor\" \"npm run dev:js\"",
|
||||
"watch": "cross-env NODE_ENV=development concurrently \"npm run watch:css-app\" \"npm run watch:css-editor\" \"npm run watch:js\"",
|
||||
"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: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: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: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\""
|
||||
},
|
||||
|
|
|
|||
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();
|
||||
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;
|
||||
}
|
||||
|
|
@ -18,4 +18,4 @@
|
|||
/* ########### BLOCKS ############ */
|
||||
|
||||
/* Home */
|
||||
@import "../../template-parts/blocks/home/home_header/home_header.css";
|
||||
@import "../../template-blocks/home/home_header.css";
|
||||
|
|
|
|||
|
|
@ -2,17 +2,27 @@
|
|||
@import "tailwindcss/utilities";
|
||||
|
||||
body {
|
||||
@apply font-sans;
|
||||
@apply font-sans;
|
||||
}
|
||||
|
||||
.wp-block{
|
||||
@apply max-w-screen-xl;
|
||||
.wp-block {
|
||||
@apply max-w-screen-xl;
|
||||
}
|
||||
|
||||
.wp-block[data-align=wide] {
|
||||
@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[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;
|
||||
}
|
||||
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>
|
||||
|
|
@ -1,35 +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">
|
||||
<?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>
|
||||
Loading…
Reference in New Issue
Block a user