diff --git a/assets/css/membro.css b/assets/css/membro.css index 29ead02..da120e5 100644 --- a/assets/css/membro.css +++ b/assets/css/membro.css @@ -113,4 +113,32 @@ .coordenadora .membro-setores span { background-color: #323232; color: #fff; +} + +/* Redes Sociais do Membro */ +.membro-redes-sociais { + display: flex; + justify-content: center; + gap: 10px; + margin-top: 5px; + margin-bottom: 5px; +} + +.membro-redes-sociais a.social-icon { + display: flex; + align-items: center; + justify-content: center; + width: 28px; + height: 28px; + border-radius: 50%; + background-color: #e0e0e0; + color: #333; + text-decoration: none; + font-size: 14px; + transition: all 0.3s ease; +} + +.membro-redes-sociais a.social-icon:hover { + background-color: #009a9a; /* theme color */ + color: #fff; } \ No newline at end of file diff --git a/home.php b/home.php index 0618cda..ec292f4 100644 --- a/home.php +++ b/home.php @@ -1,5 +1,4 @@ diff --git a/inc/custom-post-types.php b/inc/custom-post-types.php index 67e6c81..2983a8b 100644 --- a/inc/custom-post-types.php +++ b/inc/custom-post-types.php @@ -71,6 +71,48 @@ function registrar_cpt_cursos() add_action('init', 'registrar_cpt_cursos'); +// Adicionando Meta Box para Redes Sociais no CPT Membros +function registrar_meta_boxes_membros() { + add_meta_box('redes_sociais_membro', 'Redes Sociais', 'render_meta_box_redes_sociais', 'membro', 'normal', 'high'); +} +add_action('add_meta_boxes', 'registrar_meta_boxes_membros'); + +function render_meta_box_redes_sociais($post) { + $instagram = get_post_meta($post->ID, 'instagram_url', true); + $linkedin = get_post_meta($post->ID, 'linkedin_url', true); + $lattes = get_post_meta($post->ID, 'lattes_url', true); + ?> +

+
+ +

+

+
+ +

+

+
+ +

+ '; + if ($linkedin) { + echo ''; + } + if ($instagram) { + echo ''; + } + if ($lattes) { + echo ''; + } + echo ''; + } } \ No newline at end of file diff --git a/inc/shortcodes.php b/inc/shortcodes.php index 871c56c..60b9273 100644 --- a/inc/shortcodes.php +++ b/inc/shortcodes.php @@ -1,43 +1,34 @@ - '', // Atributo para receber os slugs + 'slugs' => '', ), $atts, 'membros' ); - // Converter a string de slugs em um array $slugs = array_map('trim', explode(',', $atts['slugs'])); - // Se não houver slugs, retorna vazio if (empty($slugs)) { return ''; } - // Iniciar a saída HTML $output = '
'; - // Contar quantos membros são retornados $membros_count = 0; - // Loop através dos slugs foreach ($slugs as $slug) { - // Buscar o post pelo slug $args = array( 'name' => $slug, - 'post_type' => 'membro', // Altere para o post type correto, se necessário + 'post_type' => 'membro', 'post_status' => 'publish', 'numberposts' => 1, ); $membro = get_posts($args); - // Se o post existir, gerar a estrutura if ($membro) { $post = $membro[0]; $nome = get_the_title($post->ID); @@ -48,12 +39,9 @@ function membros_shortcode($atts) { $output .= '

' . esc_html($nome) . '

'; $output .= '
'; - // Incrementa a contagem de membros $membros_count++; } } - - // Adicionar a classe dependendo do número de membros if ($membros_count === 2) { $output = str_replace('
', '
', $output); } elseif ($membros_count === 3) { @@ -66,26 +54,22 @@ function membros_shortcode($atts) { $output = str_replace('
', '
', $output); } - // Fechar a estrutura da grid $output .= '
'; - // Retornar o HTML gerado return $output; } add_shortcode('membros', 'membros_shortcode'); -// Shortcode para instrutores nas páginas de cursos -function instrutor_shortcode($atts, $content = null) { - // Define os atributos com valores padrão +function instrutor_shortcode($atts, $content = null) +{ $atts = shortcode_atts(array( 'nome' => 'Nome do Instrutor', - 'imagem' => '', // URL ou nome da imagem na biblioteca + 'imagem' => '', 'descricao' => '' ), $atts, 'instrutor'); - // Se for o nome de uma imagem da biblioteca, pega a URL if (!filter_var($atts['imagem'], FILTER_VALIDATE_URL)) { $img = get_page_by_title($atts['imagem'], OBJECT, 'attachment'); if ($img) { @@ -93,9 +77,8 @@ function instrutor_shortcode($atts, $content = null) { } } - // HTML do bloco ob_start(); - ?> +?>
@@ -107,8 +90,33 @@ function instrutor_shortcode($atts, $content = null) {

- '28 artigos publicados', + 'bg_color' => '#f2637e', + 'color' => 'white', + ), + $atts, + 'caixa_destaque' + ); + + $bg_color = esc_attr($atts['bg_color']); + $text_color = esc_attr($atts['color']); + + $style_container = "background-color: {$bg_color}; min-height: 13.5rem; display: flex; align-items: center; justify-content: center; border-radius: 15px;"; + $style_text = "margin-bottom: 0; font-weight: bold; padding: 2rem; color: white !important; text-align: center;"; + $output = '
'; + $output .= '

' . esc_html($atts['text']) . '

'; + $output .= '
'; + + return $output; +} +add_shortcode('caixa_destaque', 'color_box_shortcode'); diff --git a/page-membros.php b/page-membros.php index 83b3da4..b12cfc0 100644 --- a/page-membros.php +++ b/page-membros.php @@ -44,6 +44,7 @@

+
@@ -96,6 +97,7 @@

+ + - +