2 Commits

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;
}
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');
}
?>
+16
View File
@@ -9,6 +9,19 @@
</head>
<body <?php body_class(); ?>>
<header class="container">
<div class="site-header">
<!-- Menu secondaire à gauche -->
<nav class="secondary-navigation">
<?php
wp_nav_menu(array(
'theme_location' => 'secondary',
'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>
@@ -17,7 +30,10 @@
<?php endif; ?>
</h1>
</div>
<!-- Menu principal à droite -->
<nav class="main-navigation">
<?php wp_nav_menu(array('theme_location' => 'primary')); ?>
</nav>
</div>
</header>
+88 -1
View File
@@ -4,7 +4,7 @@ Theme URI: https://ton-site.com/wp-theme-sen2
Author: Nicolas Houzeau
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.
Version: 1.0.0
Version: 1.1.0 <!-- Ajout d'un menu à doite -->
License: GNU General Public License v2 or later
Text Domain: wp-theme-sen2
*/
@@ -87,6 +87,79 @@ header {
.main-navigation a:hover {
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 {
@@ -152,6 +225,20 @@ footer {
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 */
.about-banner {
text-align: center;