Compare commits
2 Commits
v1.3.0
..
87ebec0e5f
| Author | SHA1 | Date | |
|---|---|---|---|
| 87ebec0e5f | |||
| 8b7a042189 |
+64
-13
@@ -1,20 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
// Configuration de base
|
// Enregistrement des menus
|
||||||
function wp_theme_sen2_setup() {
|
function wp_theme_sen2_setup() {
|
||||||
// Enregistrement des menus
|
|
||||||
register_nav_menus(array(
|
register_nav_menus(array(
|
||||||
'primary' => __('Menu Principal', 'wp-theme-sen2'), // Menu principal en haut
|
'primary' => 'Menu Principal',
|
||||||
'secondary' => __('Menu Latéral', 'wp-theme-sen2') // Menu secondaire à gauche
|
|
||||||
));
|
));
|
||||||
|
|
||||||
// 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_action('after_setup_theme', 'wp_theme_sen2_setup');
|
add_action('after_setup_theme', 'wp_theme_sen2_setup');
|
||||||
|
|
||||||
// Chargement des scripts et styles
|
// Ajout des feuilles de style et scripts
|
||||||
function wp_theme_sen2_scripts() {
|
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');
|
||||||
@@ -24,19 +19,21 @@ add_action('wp_enqueue_scripts', 'wp_theme_sen2_scripts');
|
|||||||
|
|
||||||
// Custom Post Type pour Portfolio
|
// Custom Post Type pour Portfolio
|
||||||
function wp_theme_sen2_custom_post_type() {
|
function wp_theme_sen2_custom_post_type() {
|
||||||
register_post_type('portfolio', array(
|
register_post_type('portfolio',
|
||||||
|
array(
|
||||||
'labels' => array(
|
'labels' => array(
|
||||||
'name' => __('Portfolio', 'wp-theme-sen2'),
|
'name' => 'Portfolio',
|
||||||
'singular_name' => __('Projet', 'wp-theme-sen2')
|
'singular_name' => 'Projet'
|
||||||
),
|
),
|
||||||
'public' => true,
|
'public' => true,
|
||||||
'has_archive' => true,
|
'has_archive' => true,
|
||||||
'supports' => array('title', 'editor', 'thumbnail'),
|
'supports' => array('title', 'editor', 'thumbnail'),
|
||||||
));
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
add_action('init', 'wp_theme_sen2_custom_post_type');
|
add_action('init', 'wp_theme_sen2_custom_post_type');
|
||||||
|
|
||||||
// Personnalisation du slogan via Customizer
|
// Ajout d'une section "Slogan" dans le Customizer
|
||||||
function wp_theme_sen2_customize_register($wp_customize) {
|
function wp_theme_sen2_customize_register($wp_customize) {
|
||||||
$wp_customize->add_section('wp_theme_sen2_slogan_section', array(
|
$wp_customize->add_section('wp_theme_sen2_slogan_section', array(
|
||||||
'title' => __('Slogan du site', 'wp-theme-sen2'),
|
'title' => __('Slogan du site', 'wp-theme-sen2'),
|
||||||
@@ -51,8 +48,62 @@ function wp_theme_sen2_customize_register($wp_customize) {
|
|||||||
$wp_customize->add_control('wp_theme_sen2_slogan_control', array(
|
$wp_customize->add_control('wp_theme_sen2_slogan_control', array(
|
||||||
'label' => __('Slogan', 'wp-theme-sen2'),
|
'label' => __('Slogan', 'wp-theme-sen2'),
|
||||||
'section' => 'wp_theme_sen2_slogan_section',
|
'section' => 'wp_theme_sen2_slogan_section',
|
||||||
|
'settings' => 'wp_theme_sen2_slogan',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$wp_customize->add_setting('wp_theme_sen2_show_slogan', array(
|
||||||
|
'default' => true,
|
||||||
|
'sanitize_callback' => 'wp_theme_sen2_sanitize_checkbox',
|
||||||
|
));
|
||||||
|
|
||||||
|
$wp_customize->add_control('wp_theme_sen2_show_slogan_control', array(
|
||||||
|
'label' => __('Afficher le slogan', 'wp-theme-sen2'),
|
||||||
|
'section' => 'wp_theme_sen2_slogan_section',
|
||||||
|
'settings' => 'wp_theme_sen2_show_slogan',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
));
|
||||||
}
|
}
|
||||||
add_action('customize_register', 'wp_theme_sen2_customize_register');
|
add_action('customize_register', 'wp_theme_sen2_customize_register');
|
||||||
|
|
||||||
|
function wp_theme_sen2_sanitize_checkbox($checked) {
|
||||||
|
return (isset($checked) && $checked === true) ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mise à jour automatique via Gitea
|
||||||
|
add_filter('site_transient_update_themes', 'wp_theme_sen2_check_for_updates');
|
||||||
|
function wp_theme_sen2_check_for_updates($transient) {
|
||||||
|
if (empty($transient->checked)) return $transient;
|
||||||
|
|
||||||
|
$theme_data = wp_get_theme('wp-theme-sen2');
|
||||||
|
$current_version = $theme_data->get('Version');
|
||||||
|
|
||||||
|
$remote_style_css = 'http://gitea.sen2.lab/admnh/wp-theme-sen2/raw/branch/main/style.css';
|
||||||
|
$remote_data = wp_remote_get($remote_style_css, array(
|
||||||
|
'sslverify' => false,
|
||||||
|
));
|
||||||
|
|
||||||
|
if (!is_wp_error($remote_data) && $remote_data['response']['code'] === 200) {
|
||||||
|
preg_match('/Version:\s*(.*)/i', $remote_data['body'], $matches);
|
||||||
|
$remote_version = $matches[1] ?? null;
|
||||||
|
|
||||||
|
if ($remote_version && version_compare($current_version, $remote_version, '<')) {
|
||||||
|
$transient->response['wp-theme-sen2'] = array(
|
||||||
|
'theme' => 'wp-theme-sen2',
|
||||||
|
'new_version' => $remote_version,
|
||||||
|
'url' => 'http://gitea.sen2.lab/admnh/wp-theme-sen2',
|
||||||
|
'package' => 'http://gitea.sen2.lab/admnh/wp-theme-sen2/archive/main.zip',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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');
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
+8
-9
@@ -9,25 +9,19 @@
|
|||||||
</head>
|
</head>
|
||||||
<body <?php body_class(); ?>>
|
<body <?php body_class(); ?>>
|
||||||
<header class="container">
|
<header class="container">
|
||||||
<!-- Menu principal centré en haut -->
|
<div class="site-header">
|
||||||
<nav class="main-navigation">
|
|
||||||
<?php wp_nav_menu(array('theme_location' => 'primary')); ?>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="header-content">
|
|
||||||
<!-- Menu secondaire à gauche -->
|
<!-- Menu secondaire à gauche -->
|
||||||
<nav class="secondary-navigation">
|
<nav class="secondary-navigation">
|
||||||
<?php
|
<?php
|
||||||
wp_nav_menu(array(
|
wp_nav_menu(array(
|
||||||
'theme_location' => 'secondary',
|
'theme_location' => 'secondary',
|
||||||
'fallback_cb' => false,
|
'fallback_cb' => false,
|
||||||
'depth' => 1,
|
'depth' => 1
|
||||||
'container' => false
|
|
||||||
));
|
));
|
||||||
?>
|
?>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<!-- Logo centré -->
|
<!-- Logo au centre -->
|
||||||
<div class="site-branding">
|
<div class="site-branding">
|
||||||
<h1 class="site-title">
|
<h1 class="site-title">
|
||||||
<a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a>
|
<a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a>
|
||||||
@@ -36,5 +30,10 @@
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Menu principal à droite -->
|
||||||
|
<nav class="main-navigation">
|
||||||
|
<?php wp_nav_menu(array('theme_location' => 'primary')); ?>
|
||||||
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
@@ -1,6 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
Theme Name: WP Theme SEN2
|
Theme Name: WP Theme SEN2
|
||||||
Version: 1.3.0
|
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.1.0 <!-- Ajout d'un menu à doite -->
|
||||||
|
License: GNU General Public License v2 or later
|
||||||
|
Text Domain: wp-theme-sen2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Réinitialisation et base */
|
/* Réinitialisation et base */
|
||||||
@@ -11,6 +17,17 @@ body {
|
|||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #555555;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: color 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
color: #E1306C;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
@@ -19,25 +36,46 @@ body {
|
|||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Header et navigation */
|
/* Header et slogan */
|
||||||
header {
|
header {
|
||||||
padding: 20px 0;
|
background-color: #F9F9F9;
|
||||||
|
padding: 30px 0;
|
||||||
|
border-bottom: 1px solid #EEEEEE;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-navigation {
|
.site-branding {
|
||||||
text-align: center;
|
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
border-bottom: 1px solid #EEEEEE;
|
}
|
||||||
padding-bottom: 10px;
|
|
||||||
|
.site-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333333;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-title a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-slogan {
|
||||||
|
display: block;
|
||||||
|
font-family: 'Montserrat', sans-serif;
|
||||||
|
font-weight: 300;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #555555;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-navigation ul {
|
.main-navigation ul {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
gap: 20px;
|
||||||
gap: 30px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-navigation a {
|
.main-navigation a {
|
||||||
@@ -49,89 +87,81 @@ header {
|
|||||||
.main-navigation a:hover {
|
.main-navigation a:hover {
|
||||||
color: #E1306C;
|
color: #E1306C;
|
||||||
}
|
}
|
||||||
|
/* Header et navigation */
|
||||||
.header-content {
|
.site-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.secondary-navigation {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
.site-branding {
|
.site-branding {
|
||||||
width: 100%;
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.site-slogan {
|
.main-navigation {
|
||||||
display: block;
|
margin-left: auto; /* Pousse le menu principal à droite */
|
||||||
font-weight: 300;
|
|
||||||
font-size: 16px;
|
|
||||||
color: #555555;
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.secondary-navigation ul {
|
.secondary-navigation {
|
||||||
|
margin-right: auto; /* Pousse le menu secondaire à gauche */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Style des menus */
|
||||||
|
.secondary-navigation ul,
|
||||||
|
.main-navigation ul {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
gap: 20px;
|
||||||
gap: 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.secondary-navigation li {
|
.secondary-navigation a,
|
||||||
writing-mode: vertical-rl;
|
.main-navigation a {
|
||||||
text-orientation: mixed;
|
font-family: 'Montserrat', sans-serif;
|
||||||
}
|
font-weight: 400;
|
||||||
|
|
||||||
.secondary-navigation a {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #555555;
|
color: #555555;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
transition: color 0.3s ease;
|
transition: color 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.secondary-navigation a:hover {
|
.secondary-navigation a:hover,
|
||||||
|
.main-navigation a:hover {
|
||||||
color: #E1306C;
|
color: #E1306C;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Responsive */
|
/* Responsive */
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.header-content {
|
.site-header {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
gap: 15px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.site-branding {
|
||||||
|
position: static;
|
||||||
|
transform: none;
|
||||||
|
order: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.secondary-navigation {
|
.secondary-navigation {
|
||||||
position: static;
|
order: 2;
|
||||||
transform: none;
|
margin-right: 0;
|
||||||
writing-mode: horizontal-tb;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.secondary-navigation ul {
|
.main-navigation {
|
||||||
flex-direction: row;
|
order: 3;
|
||||||
justify-content: center;
|
margin-left: 0;
|
||||||
gap: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.secondary-navigation li {
|
|
||||||
writing-mode: horizontal-tb;
|
|
||||||
text-orientation: initial;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-navigation ul {
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Footer et autres styles (à conserver) */
|
/* Footer */
|
||||||
footer {
|
footer {
|
||||||
background-color: #F9F9F9;
|
background-color: #F9F9F9;
|
||||||
padding: 20px 0;
|
padding: 20px 0;
|
||||||
@@ -140,4 +170,115 @@ footer {
|
|||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Le reste de ton CSS existant... */
|
.social-icons {
|
||||||
|
margin: 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.instagram-icon {
|
||||||
|
color: #333333;
|
||||||
|
font-size: 24px;
|
||||||
|
transition: color 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.instagram-icon:hover {
|
||||||
|
color: #E1306C;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Galeries Envira */
|
||||||
|
.envira-gallery-wrap {
|
||||||
|
background-color: #F9F9F9;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin: 2em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.envira-gallery-item {
|
||||||
|
transition: transform 0.3s ease, opacity 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.envira-gallery-item:hover {
|
||||||
|
transform: scale(1.03);
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Formulaire de contact */
|
||||||
|
.wpforms-container {
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.wpforms-submit {
|
||||||
|
background-color: #333333;
|
||||||
|
color: #FFFFFF;
|
||||||
|
border: none;
|
||||||
|
padding: 12px 24px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wpforms-submit:hover {
|
||||||
|
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;
|
||||||
|
padding: 60px 20px;
|
||||||
|
background-color: #F5F5F5;
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.about-banner h1 {
|
||||||
|
font-size: 36px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.about-content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 40px;
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.about-text {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.about-image {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.about-image img {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Responsive */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.about-content {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.about-banner h1 {
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user