From 12e58c8ec79b80224c519473bbce9e7f0eddd076 Mon Sep 17 00:00:00 2001 From: Nicolas Houzeau Date: Wed, 8 Oct 2025 12:49:35 +0000 Subject: [PATCH] =?UTF-8?q?Version=201.0.0=20-=20Initialisation=20du=20th?= =?UTF-8?q?=C3=A8me=20Portfolio=20Photo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- footer.php | 11 +++ functions.php | 107 +++++++++++++++++++++++ header.php | 23 +++++ index.php | 10 +++ page-about.php | 29 +++++++ page-contact.php | 12 +++ page.php | 8 ++ single-portfolio.php | 15 ++++ style.css | 197 +++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 413 insertions(+), 1 deletion(-) create mode 100644 footer.php create mode 100644 functions.php create mode 100644 header.php create mode 100644 index.php create mode 100644 page-about.php create mode 100644 page-contact.php create mode 100644 page.php create mode 100644 single-portfolio.php create mode 100644 style.css diff --git a/.gitignore b/.gitignore index bc38396..3cbe376 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ node_modules/ /screenshot.png # Fichiers de cache *.log -*.tmp +*.tmp \ No newline at end of file diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..5b2ccc0 --- /dev/null +++ b/footer.php @@ -0,0 +1,11 @@ + + + + \ No newline at end of file diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..a66506d --- /dev/null +++ b/functions.php @@ -0,0 +1,107 @@ + 'Menu Principal', + )); + add_theme_support('post-thumbnails'); + add_theme_support('title-tag'); +} +add_action('after_setup_theme', 'portfolio_photo_setup'); + +// Ajout des feuilles de style et scripts +function portfolio_photo_scripts() { + wp_enqueue_style('wordpress-style', get_stylesheet_uri()); + wp_enqueue_style('wordpress-google-fonts', 'https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&display=swap'); + wp_enqueue_style('wordpress-font-awesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css'); +} +add_action('wp_enqueue_scripts', 'portfolio_photo_scripts'); + +// Custom Post Type pour Portfolio +function portfolio_photo_custom_post_type() { + register_post_type('portfolio', + array( + 'labels' => array( + 'name' => 'Portfolio', + 'singular_name' => 'Projet' + ), + 'public' => true, + 'has_archive' => true, + 'supports' => array('title', 'editor', 'thumbnail'), + ) + ); +} +add_action('init', 'portfolio_photo_custom_post_type'); + +// Ajout d'une section "Slogan" dans le Customizer +function portfolio_photo_customize_register($wp_customize) { + // Section pour le slogan + $wp_customize->add_section('portfolio_photo_slogan_section', array( + 'title' => __('Slogan du site', 'wordpress'), + 'priority' => 30, + )); + + // Setting pour le slogan + $wp_customize->add_setting('portfolio_photo_slogan', array( + 'default' => 'Photographier l\'humain, révéler l\'essentiel.', + 'sanitize_callback' => 'sanitize_text_field', + )); + + // Contrôle pour éditer le slogan + $wp_customize->add_control('portfolio_photo_slogan_control', array( + 'label' => __('Slogan', 'wordpress'), + 'section' => 'portfolio_photo_slogan_section', + 'settings' => 'portfolio_photo_slogan', + 'type' => 'text', + )); + + // Option pour afficher/masquer le slogan + $wp_customize->add_setting('portfolio_photo_show_slogan', array( + 'default' => true, + 'sanitize_callback' => 'portfolio_photo_sanitize_checkbox', + )); + + $wp_customize->add_control('portfolio_photo_show_slogan_control', array( + 'label' => __('Afficher le slogan', 'wordpress'), + 'section' => 'portfolio_photo_slogan_section', + 'settings' => 'portfolio_photo_show_slogan', + 'type' => 'checkbox', + )); +} +add_action('customize_register', 'portfolio_photo_customize_register'); + +// Fonction pour sanitizer le checkbox +function portfolio_photo_sanitize_checkbox($checked) { + return (isset($checked) && $checked === true) ? true : false; +} + +// Mise à jour automatique via Gitea +add_filter('site_transient_update_themes', 'portfolio_photo_check_for_updates'); +function portfolio_photo_check_for_updates($transient) { + if (empty($transient->checked)) return $transient; + + $theme_data = wp_get_theme('wordpress'); + $current_version = $theme_data->get('Version'); + + // Remplace par l'URL de ton dépôt Gitea (raw) + $remote_style_css = 'http://gitea.sen2.lab/admnh/wordpress/raw/branch/main/style.css'; + $remote_data = wp_remote_get($remote_style_css, array( + 'sslverify' => false, // Désactive la vérification SSL si ton certificat est auto-signé + )); + + 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['wordpress'] = array( + 'theme' => 'wordpress', + 'new_version' => $remote_version, + 'url' => 'http://gitea.sen2.lab/admnh/wordpress', + 'package' => 'http://gitea.sen2.lab/admnh/wordpress/archive/main.zip', + ); + } + } + return $transient; +} +?> \ No newline at end of file diff --git a/header.php b/header.php new file mode 100644 index 0000000..392307e --- /dev/null +++ b/header.php @@ -0,0 +1,23 @@ + +> + + + + + + + +> +
+
+

+ + + + +

+
+ +
\ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..a99f04f --- /dev/null +++ b/index.php @@ -0,0 +1,10 @@ + +
+ +
+

+ +
+ +
+ \ No newline at end of file diff --git a/page-about.php b/page-about.php new file mode 100644 index 0000000..57d282c --- /dev/null +++ b/page-about.php @@ -0,0 +1,29 @@ + + +
+
+

À propos de moi

+

Photographe spécialisé dans les portraits et les projets documentaires.

+
+
+
+

Mon parcours

+

Je transforme les instants éphémères en images intemporelles, avec une touche de minimalisme et d'authenticité. Mon travail a été exposé à [lieu] et publié dans [médias].

+

Ma philosophie

+

Je crois que chaque image doit raconter une histoire et éveiller une émotion. Passionné par les histoires humaines, j’ai notamment travaillé sur le projet Octobre Rose 2025.

+
+
+ +
+
+
+ + \ No newline at end of file diff --git a/page-contact.php b/page-contact.php new file mode 100644 index 0000000..c77ecc7 --- /dev/null +++ b/page-contact.php @@ -0,0 +1,12 @@ + + +
+

Me contacter

+ +
+ + \ No newline at end of file diff --git a/page.php b/page.php new file mode 100644 index 0000000..8a3e7d8 --- /dev/null +++ b/page.php @@ -0,0 +1,8 @@ + +
+ +

+ + +
+ \ No newline at end of file diff --git a/single-portfolio.php b/single-portfolio.php new file mode 100644 index 0000000..28b7aa3 --- /dev/null +++ b/single-portfolio.php @@ -0,0 +1,15 @@ + +
+ +
+

+ + +
+ +
+ \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..c77c16a --- /dev/null +++ b/style.css @@ -0,0 +1,197 @@ +/* +Theme Name: Portfolio Photo Blanc Cassé +Theme URI: https://ton-site.com/portfolio-photo +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 +License: GNU General Public License v2 or later +Text Domain: portfolio-photo +*/ + +/* Réinitialisation et base */ +body { + font-family: 'Montserrat', sans-serif; + background-color: #F9F9F9; + color: #333333; + line-height: 1.6; + margin: 0; + padding: 0; + font-size: 16px; +} + +a { + color: #555555; + text-decoration: none; + transition: color 0.3s ease; +} + +a:hover { + color: #E1306C; +} + +.container { + max-width: 1200px; + margin: 0 auto; + padding: 0 20px; +} + +/* Header et slogan */ +header { + background-color: #F9F9F9; + padding: 30px 0; + border-bottom: 1px solid #EEEEEE; +} + +.site-branding { + margin-bottom: 20px; +} + +.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 { + list-style: none; + padding: 0; + margin: 0; + display: flex; + gap: 20px; +} + +.main-navigation a { + font-weight: 500; + color: #333333; + text-decoration: none; +} + +.main-navigation a:hover { + color: #E1306C; +} + +/* Footer */ +footer { + background-color: #F9F9F9; + padding: 20px 0; + text-align: center; + border-top: 1px solid #EEEEEE; + margin-top: 40px; +} + +.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; +} + +/* 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; + } +}