Version 1.0.0 - Initialisation du thème Portfolio Photo

This commit is contained in:
2025-10-08 12:49:35 +00:00
parent 936a35557c
commit 12e58c8ec7
10 changed files with 413 additions and 1 deletions
+1 -1
View File
@@ -5,4 +5,4 @@ node_modules/
/screenshot.png
# Fichiers de cache
*.log
*.tmp
*.tmp
+11
View File
@@ -0,0 +1,11 @@
<footer class="container">
<div class="social-icons">
<a href="https://www.instagram.com/sen2_fr/" target="_blank" rel="noopener noreferrer" class="instagram-icon">
<i class="fab fa-instagram"></i>
</a>
</div>
<p>&copy; <?php echo date('Y'); ?> <?php bloginfo('name'); ?></p>
</footer>
<?php wp_footer(); ?>
</body>
</html>
+107
View File
@@ -0,0 +1,107 @@
<?php
// Enregistrement des menus
function portfolio_photo_setup() {
register_nav_menus(array(
'primary' => '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;
}
?>
+23
View File
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<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 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">
<div class="site-branding">
<h1 class="site-title">
<a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a>
<?php if (get_theme_mod('portfolio_photo_show_slogan', true)) : ?>
<span class="site-slogan"><?php echo esc_html(get_theme_mod('portfolio_photo_slogan', 'Photographier l\'humain, révéler l\'essentiel.')); ?></span>
<?php endif; ?>
</h1>
</div>
<nav class="main-navigation">
<?php wp_nav_menu(array('theme_location' => 'primary')); ?>
</nav>
</header>
+10
View File
@@ -0,0 +1,10 @@
<?php get_header(); ?>
<main class="container">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php the_content(); ?>
</article>
<?php endwhile; endif; ?>
</main>
<?php get_footer(); ?>
+29
View File
@@ -0,0 +1,29 @@
<?php
/*
Template Name: À propos
*/
get_header(); ?>
<main class="container">
<section class="about-banner">
<h1>À propos de moi</h1>
<p>Photographe spécialisé dans les portraits et les projets documentaires.</p>
</section>
<section class="about-content">
<div class="about-text">
<h2>Mon parcours</h2>
<p>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].</p>
<h2>Ma philosophie</h2>
<p>Je crois que chaque image doit raconter une histoire et éveiller une émotion. Passionné par les histoires humaines, jai notamment travaillé sur le projet <strong>Octobre Rose 2025</strong>.</p>
</div>
<div class="about-image">
<?php
if (has_post_thumbnail()) {
the_post_thumbnail('large');
}
?>
</div>
</section>
</main>
<?php get_footer(); ?>
+12
View File
@@ -0,0 +1,12 @@
<?php
/*
Template Name: Contact
*/
get_header(); ?>
<main class="container">
<h1>Me contacter</h1>
<?php echo do_shortcode('[wpforms id="123"]'); // Remplace 123 par l'ID de ton formulaire WPForms ?>
</main>
<?php get_footer(); ?>
+8
View File
@@ -0,0 +1,8 @@
<?php get_header(); ?>
<main class="container">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</main>
<?php get_footer(); ?>
+15
View File
@@ -0,0 +1,15 @@
<?php get_header(); ?>
<main class="container">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<article>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php
if (class_exists('Envira_Gallery')) {
echo do_shortcode('[envira-gallery id="' . get_post_meta(get_the_ID(), 'envira_gallery', true) . '"]');
}
?>
</article>
<?php endwhile; endif; ?>
</main>
<?php get_footer(); ?>
+197
View File
@@ -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;
}
}