FEAT: Ajout d'un menu secondaire à dgauche vec liens Contact et À propos #1

Merged
admnh merged 1 commits from feature/add-right-menu into main 2025-10-08 17:28:36 +02:00
3 changed files with 122 additions and 11 deletions
+8
View File
@@ -98,4 +98,12 @@ function wp_theme_sen2_check_for_updates($transient) {
} }
return $transient; return $transient;
} }
function wp_theme_sen2_setup() {
register_nav_menus(array(
'primary' => 'Menu Principal',
'secondary' => 'Menu Secondaire' // Nouveau menu
));
add_theme_support('post-thumbnails');
add_theme_support('title-tag');
}
?> ?>
+26 -10
View File
@@ -9,15 +9,31 @@
</head> </head>
<body <?php body_class(); ?>> <body <?php body_class(); ?>>
<header class="container"> <header class="container">
<div class="site-branding"> <div class="site-header">
<h1 class="site-title"> <!-- Menu secondaire à gauche -->
<a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a> <nav class="secondary-navigation">
<?php if (get_theme_mod('wp_theme_sen2_show_slogan', true)) : ?> <?php
<span class="site-slogan"><?php echo esc_html(get_theme_mod('wp_theme_sen2_slogan', 'Photographier l\'humain, révéler l\'essentiel.')); ?></span> wp_nav_menu(array(
<?php endif; ?> 'theme_location' => 'secondary',
</h1> 'fallback_cb' => false,
'depth' => 1
));
?>
</nav>
<!-- Logo au centre -->
<div class="site-branding">
<h1 class="site-title">
<a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a>
<?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>
<?php endif; ?>
</h1>
</div>
<!-- Menu principal à droite -->
<nav class="main-navigation">
<?php wp_nav_menu(array('theme_location' => 'primary')); ?>
</nav>
</div> </div>
<nav class="main-navigation">
<?php wp_nav_menu(array('theme_location' => 'primary')); ?>
</nav>
</header> </header>
+88 -1
View File
@@ -4,7 +4,7 @@ Theme URI: https://ton-site.com/wp-theme-sen2
Author: Nicolas Houzeau Author: Nicolas Houzeau
Author URI: https://ton-site.com Author URI: https://ton-site.com
Description: Un thème sobre et moderne pour portfolio photo, en blanc cassé. Compatible avec Envira Gallery et personnalisable via le Customizer. Description: Un thème sobre et moderne pour portfolio photo, en blanc cassé. Compatible avec Envira Gallery et personnalisable via le Customizer.
Version: 1.0.0 Version: 1.1.0 <!-- Ajout d'un menu à doite -->
License: GNU General Public License v2 or later License: GNU General Public License v2 or later
Text Domain: wp-theme-sen2 Text Domain: wp-theme-sen2
*/ */
@@ -87,6 +87,79 @@ header {
.main-navigation a:hover { .main-navigation a:hover {
color: #E1306C; color: #E1306C;
} }
/* Header et navigation */
.site-header {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
position: relative;
}
.site-branding {
position: absolute;
left: 50%;
transform: translateX(-50%);
text-align: center;
margin: 0 auto;
}
.main-navigation {
margin-left: auto; /* Pousse le menu principal à droite */
}
.secondary-navigation {
margin-right: auto; /* Pousse le menu secondaire à gauche */
}
/* Style des menus */
.secondary-navigation ul,
.main-navigation ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
gap: 20px;
}
.secondary-navigation a,
.main-navigation a {
font-family: 'Montserrat', sans-serif;
font-weight: 400;
color: #555555;
text-decoration: none;
transition: color 0.3s ease;
}
.secondary-navigation a:hover,
.main-navigation a:hover {
color: #E1306C;
}
/* Responsive */
@media (max-width: 768px) {
.site-header {
flex-direction: column;
gap: 15px;
position: relative;
}
.site-branding {
position: static;
transform: none;
order: 1;
}
.secondary-navigation {
order: 2;
margin-right: 0;
}
.main-navigation {
order: 3;
margin-left: 0;
}
}
/* Footer */ /* Footer */
footer { footer {
@@ -152,6 +225,20 @@ footer {
background-color: #E1306C; background-color: #E1306C;
} }
/* Responsive */
@media (max-width: 768px) {
.site-header {
flex-direction: column;
gap: 15px;
}
.secondary-navigation {
order: 3;
width: 100%;
justify-content: center;
}
}
/* Page À propos */ /* Page À propos */
.about-banner { .about-banner {
text-align: center; text-align: center;