1.1.0
This commit is contained in:
48
header.php
Normal file
48
header.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<header>
|
||||
<?php
|
||||
// ... (existing code)
|
||||
|
||||
// Before the main content, or in a sidebar area
|
||||
if (!is_user_logged_in()) { // Only show the form if the user is not logged in
|
||||
echo '<div class="login-form-container">';
|
||||
echo '<h2>Connexion</h2>';
|
||||
wp_login_form(array(
|
||||
'redirect' => home_url(), // Redirects to the homepage after login
|
||||
'label_username' => __('Utilisateur/Courriel', 'my-custom-theme'),
|
||||
'label_password' => __('Mot de passe', 'my-custom-theme'),
|
||||
'label_remember' => __('Se souvenir de moi', 'my-custom-theme'),
|
||||
'label_log_in' => __('Connexion', 'my-custom-theme'),
|
||||
'id_username' => 'user_login',
|
||||
'id_password' => 'user_pass',
|
||||
'id_remember' => 'rememberme',
|
||||
'id_submit' => 'wp-submit',
|
||||
'remember' => true,
|
||||
'value_username' => '',
|
||||
'value_remember' => false // Default to not checked
|
||||
));
|
||||
echo '<p class="login-links">';
|
||||
echo '<a href="' . wp_registration_url() . '">' . __('Créer un compte', 'my-custom-theme') . '</a> | ';
|
||||
echo '<a href="' . wp_lostpassword_url() . '">' . __('Oublié votre mot de passe?', 'my-custom-theme') . '</a>';
|
||||
echo '</p>';
|
||||
echo '</div>';
|
||||
} else {
|
||||
// Optional: Display a message for logged-in users
|
||||
echo '<div class="logged-in-message">';
|
||||
echo '<h3>' . sprintf(__('Bienvenue, <a href="/wp-admin/profile.php">%s</a>!', 'my-custom-theme'), wp_get_current_user()->display_name) . '</h3> <h4><a href="' . wp_logout_url(home_url()) . '">' . __('Déconnexion', 'my-custom-theme') . '</a></h4>';
|
||||
echo '</div>';
|
||||
}
|
||||
// ... (rest of your existing code)
|
||||
?>
|
||||
<?php
|
||||
if (function_exists('the_custom_logo')) {
|
||||
the_custom_logo();
|
||||
}
|
||||
?>
|
||||
<br>
|
||||
<h3>Thème WordPress par mikx. Créé avec l'aide de Gemini.</h3><br>
|
||||
<h3>Pour me rejoindre</h3>
|
||||
<h4><a href="https://www.facebook.com/groups/2141742079467131" target="_blank">Facebook</a></h4>
|
||||
<h4><a href="http://discord.mxg.ovh" target="_blank">Discord</a></h4>
|
||||
<h3>Setup</h3> <h4><a href="/index.php/setup-maison/">Maison</a></h4> <h4><a href="/index.php/setup-ovh/">OVH</a></h4>
|
||||
</header>
|
||||
<br>
|
||||
Reference in New Issue
Block a user