41506151000101
Criar um código no functions.php (APRESENTAÇÃO – EDITOR DE FICHEIROS DE TEMAS) para gerar um botão de logout:
function custom_logout_button() {
if (is_user_logged_in()) {
$logout_url = wp_logout_url(home_url(‘/’));
$button_markup = ‘<a href=”‘ . esc_url($logout_url) . ‘” class=”btn-logout”>LOGOUT</a>’;
return $button_markup;
}
add_shortcode(‘custom_logout_button’, ‘custom_logout_button’);
SHORT CODE
ENTRE COLCHETES custom_logout_button
[custom_logout_button]
CSS Avançado PARA BOTÃO
/* Estilo do botão de logout */
.btn-logout {
display: inline-block;
padding: 10px 20px;
background-color: #F76831;
/* Cor de fundo do botão */
color: #fff; /* Cor do texto do botão */
text-decoration: none;
border-radius: 5px; /* Borda arredondada */
transition: background-color 0.3s ease;
.btn-logout:hover {
background-color: #FA8A2C; /* Mudança de cor ao passar o mouse */