5 Commits

Author SHA1 Message Date
Nico d5b8237b72 FEAT: Menu latéral gauche aligné avec galerie - v1.4.0 2025-10-08 20:07:38 +00:00
admnh 038d0f2743 revert 8b7a042189
revert FEAT: Ajout d'un menu secondaire à dgauche vec liens Contact et À propos
2025-10-08 17:48:49 +02:00
admnh 12a449f64c revert 8b7a042189
revert FEAT: Ajout d'un menu secondaire à dgauche vec liens Contact et À propos
2025-10-08 17:48:06 +02:00
admnh 87ebec0e5f Merge pull request 'FEAT: Ajout d'un menu secondaire à dgauche vec liens Contact et À propos' (#1) from feature/add-right-menu into main
Reviewed-on: https://gitea.sen2.lab/admnh/wp-theme-sen2/pulls/1
2025-10-08 17:28:36 +02:00
Nico 8b7a042189 FEAT: Ajout d'un menu secondaire à dgauche vec liens Contact et À propos 2025-10-08 15:24:30 +00:00
4 changed files with 142 additions and 111 deletions
+10 -3
View File
@@ -3,14 +3,17 @@
function wp_theme_sen2_setup() { function wp_theme_sen2_setup() {
// Enregistrement des menus // Enregistrement des menus
register_nav_menus(array( register_nav_menus(array(
'primary' => __('Menu Principal', 'wp-theme-sen2'), // Menu principal en haut 'sidebar' => __('Menu Latéral', 'wp-theme-sen2') // Menu latéral gauche
'secondary' => __('Menu Latéral', 'wp-theme-sen2') // Menu secondaire à gauche
)); ));
// Supports du thème // Supports du thème
add_theme_support('post-thumbnails'); add_theme_support('post-thumbnails');
add_theme_support('title-tag'); add_theme_support('title-tag');
add_theme_support('automatic-feed-links'); add_theme_support('automatic-feed-links');
add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
// Largeur des images pour le thème
add_theme_support('align-wide');
} }
add_action('after_setup_theme', 'wp_theme_sen2_setup'); add_action('after_setup_theme', 'wp_theme_sen2_setup');
@@ -19,6 +22,9 @@ function wp_theme_sen2_scripts() {
wp_enqueue_style('wp-theme-sen2-style', get_stylesheet_uri()); wp_enqueue_style('wp-theme-sen2-style', get_stylesheet_uri());
wp_enqueue_style('wp-theme-sen2-google-fonts', 'https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&display=swap'); wp_enqueue_style('wp-theme-sen2-google-fonts', 'https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&display=swap');
wp_enqueue_style('wp-theme-sen2-font-awesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css'); wp_enqueue_style('wp-theme-sen2-font-awesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');
// Script pour le menu latéral (si besoin)
wp_enqueue_script('wp-theme-sen2-script', get_template_directory_uri() . '/js/script.js', array(), '1.0.0', true);
} }
add_action('wp_enqueue_scripts', 'wp_theme_sen2_scripts'); add_action('wp_enqueue_scripts', 'wp_theme_sen2_scripts');
@@ -32,6 +38,7 @@ function wp_theme_sen2_custom_post_type() {
'public' => true, 'public' => true,
'has_archive' => true, 'has_archive' => true,
'supports' => array('title', 'editor', 'thumbnail'), 'supports' => array('title', 'editor', 'thumbnail'),
'rewrite' => array('slug' => 'portfolio'),
)); ));
} }
add_action('init', 'wp_theme_sen2_custom_post_type'); add_action('init', 'wp_theme_sen2_custom_post_type');
@@ -44,7 +51,7 @@ function wp_theme_sen2_customize_register($wp_customize) {
)); ));
$wp_customize->add_setting('wp_theme_sen2_slogan', array( $wp_customize->add_setting('wp_theme_sen2_slogan', array(
'default' => 'Photographier l\'humain, révéler l\'essentiel.', 'default' => 'Moins de bruit, plus d\'âme.',
'sanitize_callback' => 'sanitize_text_field', 'sanitize_callback' => 'sanitize_text_field',
)); ));
+20 -21
View File
@@ -8,33 +8,32 @@
<?php wp_head(); ?> <?php wp_head(); ?>
</head> </head>
<body <?php body_class(); ?>> <body <?php body_class(); ?>>
<header class="container"> <div class="site-container">
<!-- Menu principal centré en haut --> <!-- Menu latéral gauche -->
<nav class="main-navigation"> <aside class="sidebar">
<?php wp_nav_menu(array('theme_location' => 'primary')); ?> <nav class="sidebar-navigation">
</nav>
<div class="header-content">
<!-- Menu secondaire à gauche -->
<nav class="secondary-navigation">
<?php <?php
wp_nav_menu(array( wp_nav_menu(array(
'theme_location' => 'secondary', 'theme_location' => 'sidebar',
'container' => false,
'fallback_cb' => false, 'fallback_cb' => false,
'depth' => 1, 'depth' => 1
'container' => false
)); ));
?> ?>
</nav> </nav>
</aside>
<!-- Logo centré --> <!-- Contenu principal -->
<div class="site-branding"> <div class="main-content">
<h1 class="site-title"> <header class="site-header">
<a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a> <div class="site-branding">
<h1 class="site-title">
<a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a>
</h1>
<?php if (get_theme_mod('wp_theme_sen2_show_slogan', true)) : ?> <?php if (get_theme_mod('wp_theme_sen2_show_slogan', true)) : ?>
<span class="site-slogan"><?php echo esc_html(get_theme_mod('wp_theme_sen2_slogan', 'Photographier l\'humain, révéler l\'essentiel.')); ?></span> <span class="site-slogan"><?php echo esc_html(get_theme_mod('wp_theme_sen2_slogan', 'Moins de bruit, plus d\'âme.')); ?></span>
<?php endif; ?> <?php endif; ?>
</h1> </div>
</div> </header>
</div>
</header> <main class="site-main">
+18
View File
@@ -0,0 +1,18 @@
document.addEventListener('DOMContentLoaded', function() {
// Gestion du menu latéral en mobile si nécessaire
const sidebar = document.querySelector('.sidebar');
const mainContent = document.querySelector('.main-content');
// Ajoute une classe pour le mode mobile
function checkScreenSize() {
if (window.innerWidth <= 768) {
document.body.classList.add('mobile-view');
} else {
document.body.classList.remove('mobile-view');
}
}
// Exécute au chargement et au redimensionnement
checkScreenSize();
window.addEventListener('resize', checkScreenSize);
});
+94 -87
View File
@@ -1,143 +1,150 @@
/* /*
Theme Name: WP Theme SEN2 Theme Name: WP Theme SEN2
Version: 1.3.0 Version: 1.4.0
*/ */
/* Réinitialisation et base */ /* Réinitialisation et base */
:root {
--primary-color: #3498DB;
--secondary-color: #2C3E50;
--text-color: #333333;
--light-gray: #F9F9F9;
--medium-gray: #E0E0E0;
}
body { body {
font-family: 'Montserrat', sans-serif; font-family: 'Montserrat', sans-serif;
background-color: #F9F9F9; background-color: var(--light-gray);
color: #333333; color: var(--text-color);
line-height: 1.6; line-height: 1.6;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
.container { /* Structure globale */
max-width: 1200px; .site-container {
margin: 0 auto; display: grid;
padding: 0 20px; grid-template-columns: 200px 1fr;
min-height: 100vh;
} }
/* Header et navigation */ .sidebar {
header { background-color: #FFFFFF;
padding: 20px 0; padding: 20px 0;
} position: fixed;
.main-navigation {
text-align: center;
margin-bottom: 20px;
border-bottom: 1px solid #EEEEEE;
padding-bottom: 10px;
}
.main-navigation ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
gap: 30px;
}
.main-navigation a {
font-weight: 500;
color: #333333;
text-decoration: none;
}
.main-navigation a:hover {
color: #E1306C;
}
.header-content {
display: flex;
align-items: center;
position: relative;
}
.secondary-navigation {
position: absolute;
left: 0; left: 0;
top: 50%; top: 0;
transform: translateY(-50%); bottom: 0;
z-index: 10; width: 200px;
z-index: 100;
border-right: 1px solid var(--medium-gray);
} }
.site-branding { .main-content {
width: 100%; margin-left: 200px;
padding: 20px;
}
.site-header {
text-align: center; text-align: center;
padding: 20px 0;
border-bottom: 1px solid var(--medium-gray);
margin-bottom: 30px;
}
.site-title {
margin: 0;
font-size: 28px;
font-weight: 600;
color: var(--secondary-color);
}
.site-title a {
text-decoration: none;
color: inherit;
} }
.site-slogan { .site-slogan {
display: block; display: block;
font-weight: 300; font-weight: 300;
font-size: 16px; font-size: 16px;
color: #555555; color: #7F8C8D;
margin-top: 5px; margin-top: 10px;
} }
.secondary-navigation ul { /* Menu latéral */
.sidebar-navigation {
padding: 0 20px;
}
.sidebar-navigation ul {
list-style: none; list-style: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
display: flex;
flex-direction: column;
gap: 10px;
} }
.secondary-navigation li { .sidebar-navigation li {
writing-mode: vertical-rl; margin-bottom: 10px;
text-orientation: mixed;
} }
.secondary-navigation a { .sidebar-navigation a {
font-size: 14px; display: block;
color: #555555; color: var(--text-color);
text-decoration: none; text-decoration: none;
transition: color 0.3s ease; padding: 8px 15px;
border-radius: 4px;
transition: all 0.3s ease;
} }
.secondary-navigation a:hover { .sidebar-navigation a:hover,
color: #E1306C; .sidebar-navigation .current-menu-item a {
background-color: var(--primary-color);
color: white;
} }
/* Responsive */ /* Responsive */
@media (max-width: 768px) { @media (max-width: 768px) {
.header-content { .site-container {
flex-direction: column; grid-template-columns: 1fr;
} }
.secondary-navigation { .sidebar {
position: static; position: relative;
transform: none; width: 100%;
writing-mode: horizontal-tb; border-right: none;
margin-bottom: 20px; border-bottom: 1px solid var(--medium-gray);
} }
.secondary-navigation ul { .main-content {
flex-direction: row; margin-left: 0;
}
.sidebar-navigation ul {
display: flex;
justify-content: center; justify-content: center;
gap: 20px; gap: 20px;
padding: 0;
} }
.secondary-navigation li { .sidebar-navigation li {
writing-mode: horizontal-tb; margin-bottom: 0;
text-orientation: initial;
}
.main-navigation ul {
flex-wrap: wrap;
} }
} }
/* Footer et autres styles (à conserver) */ /* Galerie et contenu */
footer { .site-main {
background-color: #F9F9F9;
padding: 20px 0; padding: 20px 0;
}
.envira-gallery-wrap {
margin-left: 0; /* Alignement avec le menu latéral */
}
/* Footer */
.site-footer {
background-color: var(--light-gray);
padding: 30px 0;
text-align: center; text-align: center;
border-top: 1px solid #EEEEEE; border-top: 1px solid var(--medium-gray);
margin-top: 40px; margin-top: 40px;
} }
/* Le reste de ton CSS existant... */