Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c4ebd8690 | |||
| e0e11a5c0c | |||
| d5b8237b72 | |||
| 038d0f2743 | |||
| 12a449f64c | |||
| 87ebec0e5f | |||
| 8b7a042189 |
+11
-19
@@ -3,8 +3,8 @@
|
||||
function wp_theme_sen2_setup() {
|
||||
// Enregistrement des menus
|
||||
register_nav_menus(array(
|
||||
'primary' => __('Menu Principal', 'wp-theme-sen2'), // Menu principal en haut
|
||||
'secondary' => __('Menu Latéral', 'wp-theme-sen2') // Menu secondaire à gauche
|
||||
'primary' => __('Menu Principal', 'wp-theme-sen2'), // Menu horizontal en haut
|
||||
'sidebar' => __('Menu Latéral', 'wp-theme-sen2') // Menu latéral gauche
|
||||
));
|
||||
|
||||
// Supports du thème
|
||||
@@ -17,26 +17,12 @@ add_action('after_setup_theme', 'wp_theme_sen2_setup');
|
||||
// Chargement des scripts et styles
|
||||
function wp_theme_sen2_scripts() {
|
||||
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;600;700&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');
|
||||
}
|
||||
add_action('wp_enqueue_scripts', 'wp_theme_sen2_scripts');
|
||||
|
||||
// Custom Post Type pour Portfolio
|
||||
function wp_theme_sen2_custom_post_type() {
|
||||
register_post_type('portfolio', array(
|
||||
'labels' => array(
|
||||
'name' => __('Portfolio', 'wp-theme-sen2'),
|
||||
'singular_name' => __('Projet', 'wp-theme-sen2')
|
||||
),
|
||||
'public' => true,
|
||||
'has_archive' => true,
|
||||
'supports' => array('title', 'editor', 'thumbnail'),
|
||||
));
|
||||
}
|
||||
add_action('init', 'wp_theme_sen2_custom_post_type');
|
||||
|
||||
// Personnalisation du slogan via Customizer
|
||||
// Personnalisation du slogan
|
||||
function wp_theme_sen2_customize_register($wp_customize) {
|
||||
$wp_customize->add_section('wp_theme_sen2_slogan_section', array(
|
||||
'title' => __('Slogan du site', 'wp-theme-sen2'),
|
||||
@@ -44,7 +30,7 @@ function wp_theme_sen2_customize_register($wp_customize) {
|
||||
));
|
||||
|
||||
$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',
|
||||
));
|
||||
|
||||
@@ -55,4 +41,10 @@ function wp_theme_sen2_customize_register($wp_customize) {
|
||||
));
|
||||
}
|
||||
add_action('customize_register', 'wp_theme_sen2_customize_register');
|
||||
|
||||
// Supprimer le footer TurnKey Linux
|
||||
function remove_turnkey_footer() {
|
||||
remove_action('wp_footer', 'turnkey_footer_credit');
|
||||
}
|
||||
add_action('init', 'remove_turnkey_footer');
|
||||
?>
|
||||
+38
-26
@@ -3,38 +3,50 @@
|
||||
<head>
|
||||
<meta charset="<?php bloginfo('charset'); ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
<body <?php body_class(); ?>>
|
||||
<header class="container">
|
||||
<!-- Menu principal centré en haut -->
|
||||
<div class="site-wrapper">
|
||||
<!-- Menu horizontal en haut -->
|
||||
<nav class="main-navigation">
|
||||
<?php wp_nav_menu(array('theme_location' => 'primary')); ?>
|
||||
<?php
|
||||
wp_nav_menu(array(
|
||||
'theme_location' => 'primary',
|
||||
'container' => false,
|
||||
'fallback_cb' => false,
|
||||
'depth' => 1
|
||||
));
|
||||
?>
|
||||
</nav>
|
||||
|
||||
<div class="header-content">
|
||||
<!-- Menu secondaire à gauche -->
|
||||
<nav class="secondary-navigation">
|
||||
<?php
|
||||
wp_nav_menu(array(
|
||||
'theme_location' => 'secondary',
|
||||
'fallback_cb' => false,
|
||||
'depth' => 1,
|
||||
'container' => false
|
||||
));
|
||||
?>
|
||||
</nav>
|
||||
|
||||
<!-- Logo centré -->
|
||||
<div class="site-branding">
|
||||
<h1 class="site-title">
|
||||
<a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a>
|
||||
<div class="site-container">
|
||||
<!-- Menu latéral gauche -->
|
||||
<aside class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<h2 class="site-author"><?php bloginfo('name'); ?></h2>
|
||||
<?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>
|
||||
<p class="site-slogan"><?php echo esc_html(get_theme_mod('wp_theme_sen2_slogan', 'Moins de bruit, plus d\'âme.')); ?></p>
|
||||
<?php endif; ?>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
<nav class="sidebar-navigation">
|
||||
<?php
|
||||
wp_nav_menu(array(
|
||||
'theme_location' => 'sidebar',
|
||||
'container' => false,
|
||||
'fallback_cb' => false,
|
||||
'depth' => 1
|
||||
));
|
||||
?>
|
||||
</nav>
|
||||
|
||||
<div class="sidebar-footer">
|
||||
<a href="#" class="instagram-icon"><i class="fab fa-instagram"></i></a>
|
||||
<p class="copyright">© <?php echo date('Y'); ?> <?php bloginfo('name'); ?></p>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- Contenu principal -->
|
||||
<main class="main-content">
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
@@ -1,34 +1,75 @@
|
||||
/*
|
||||
Theme Name: WP Theme SEN2
|
||||
Version: 1.3.0
|
||||
Version: 1.6.0
|
||||
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.
|
||||
License: GNU General Public License v2 or later
|
||||
*/
|
||||
|
||||
/* Réinitialisation et base */
|
||||
:root {
|
||||
--primary-color: #2C3E50;
|
||||
--secondary-color: #3498DB;
|
||||
--text-color: #333333;
|
||||
--light-gray: #F9F9F9;
|
||||
--medium-gray: #E0E0E0;
|
||||
--dark-gray: #7F8C8D;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Montserrat', sans-serif;
|
||||
background-color: #F9F9F9;
|
||||
color: #333333;
|
||||
background-color: var(--light-gray);
|
||||
color: var(--text-color);
|
||||
line-height: 1.6;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 0 20px;
|
||||
/* Structure globale */
|
||||
.site-wrapper {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* Header et navigation */
|
||||
header {
|
||||
padding: 20px 0;
|
||||
.site-container {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
min-height: calc(100vh - 60px); /* 60px = hauteur du menu horizontal */
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
width: 250px;
|
||||
background-color: white;
|
||||
padding: 30px 20px;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 60px; /* Espace pour le menu horizontal */
|
||||
bottom: 0;
|
||||
overflow-y: auto;
|
||||
border-right: 1px solid var(--medium-gray);
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
margin-left: 250px; /* Même largeur que le sidebar */
|
||||
flex: 1;
|
||||
padding: 30px;
|
||||
width: calc(100% - 250px); /* Largeur calculée pour éviter le chevauchement */
|
||||
min-height: calc(100vh - 60px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
/* Menu horizontal en haut */
|
||||
.main-navigation {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
border-bottom: 1px solid #EEEEEE;
|
||||
padding-bottom: 10px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: white;
|
||||
padding: 15px 0;
|
||||
border-bottom: 1px solid var(--medium-gray);
|
||||
z-index: 20;
|
||||
}
|
||||
|
||||
.main-navigation ul {
|
||||
@@ -38,106 +79,129 @@ header {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 30px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.main-navigation a {
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.main-navigation a:hover {
|
||||
color: #E1306C;
|
||||
}
|
||||
|
||||
.header-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.secondary-navigation {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.site-branding {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.site-slogan {
|
||||
display: block;
|
||||
font-weight: 300;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
color: #555555;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.secondary-navigation ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.secondary-navigation li {
|
||||
writing-mode: vertical-rl;
|
||||
text-orientation: mixed;
|
||||
}
|
||||
|
||||
.secondary-navigation a {
|
||||
font-size: 14px;
|
||||
color: #555555;
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
.secondary-navigation a:hover {
|
||||
color: #E1306C;
|
||||
.main-navigation a:hover {
|
||||
color: var(--secondary-color);
|
||||
}
|
||||
|
||||
/* Menu latéral */
|
||||
.sidebar-header {
|
||||
margin-bottom: 30px;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid var(--medium-gray);
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.site-author {
|
||||
margin: 0;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.site-slogan {
|
||||
margin: 10px 0 0;
|
||||
font-size: 14px;
|
||||
font-weight: 300;
|
||||
color: var(--dark-gray);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.sidebar-navigation {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.sidebar-navigation ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.sidebar-navigation li {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.sidebar-navigation a {
|
||||
color: var(--text-color);
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
font-size: 16px;
|
||||
display: block;
|
||||
padding: 5px 0;
|
||||
border-bottom: 1px solid var(--medium-gray);
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
.sidebar-navigation a:hover {
|
||||
color: var(--secondary-color);
|
||||
}
|
||||
|
||||
/* Footer dans le sidebar */
|
||||
.sidebar-footer {
|
||||
margin-top: auto;
|
||||
text-align: center;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid var(--medium-gray);
|
||||
}
|
||||
|
||||
.instagram-icon {
|
||||
color: var(--primary-color);
|
||||
font-size: 20px;
|
||||
margin-bottom: 10px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
color: var(--dark-gray);
|
||||
}
|
||||
|
||||
/* Contenu principal */
|
||||
.site-main {
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 768px) {
|
||||
.header-content {
|
||||
.site-container {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.secondary-navigation {
|
||||
position: static;
|
||||
transform: none;
|
||||
writing-mode: horizontal-tb;
|
||||
margin-bottom: 20px;
|
||||
.sidebar {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
top: 60px;
|
||||
border-right: none;
|
||||
border-bottom: 1px solid var(--medium-gray);
|
||||
}
|
||||
|
||||
.secondary-navigation ul {
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.secondary-navigation li {
|
||||
writing-mode: horizontal-tb;
|
||||
text-orientation: initial;
|
||||
.main-content {
|
||||
margin-left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.main-navigation ul {
|
||||
flex-wrap: wrap;
|
||||
flex-direction: column;
|
||||
gap: 15px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
/* Footer et autres styles (à conserver) */
|
||||
footer {
|
||||
background-color: #F9F9F9;
|
||||
padding: 20px 0;
|
||||
text-align: center;
|
||||
border-top: 1px solid #EEEEEE;
|
||||
margin-top: 40px;
|
||||
/* Galerie */
|
||||
.envira-gallery-wrap {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Le reste de ton CSS existant... */
|
||||
Reference in New Issue
Block a user