Ocultar nombre de páginas

				
					// Ocultar el título por defecto en todas las páginas con Hello Elementor
add_filter( 'the_title', 'ocultar_titulo_paginas_hello_elementor', 10, 2 );

function ocultar_titulo_paginas_hello_elementor( $title, $post_id ) {
    // Solo aplicar en el contenido principal y para el tipo de post "page"
    if ( is_admin() || !is_page( $post_id ) || !in_the_loop() || is_singular( 'post' ) ) {
        return $title;
    }

    // Devuelve una cadena vacía para ocultar el título
    return '';
}

				
			

Redirigir al Checkout

				
					
add_filter('woocommerce_add_to_cart_redirect', 'redireccionar_al_checkout');

function redireccionar_al_checkout() {
    return wc_get_checkout_url();
}

				
			

Spotlight

				
					<div class="spotlight-container">
  <div class="spotlight-text">Aquí debería haber un texto normal. Pero esto no es un evento normal. Las mejores estrategias, los atajos reales, secretos y los errores que nadie confiesa... se confiesan entre nosotros. ¿Curiosidad? ¿Te intriga? Solo los miembros pueden ver lo que hay detrás del telón.</div>
</div>

<style>
.spotlight-container {
  position: relative;
  background: black;
  color: #fff;
  font-family: monospace;
  font-size: 2rem;
  padding: 40px;
  overflow: hidden;
}

.spotlight-text {
  mask-image: radial-gradient(circle 150px at var(--x, 50%) var(--y, 50%), white 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle 150px at var(--x, 50%) var(--y, 50%), white 0%, transparent 100%);
  transition: mask-image 0.2s, -webkit-mask-image 0.2s;
}

.spotlight-container:hover .spotlight-text {
  cursor: none;
}

</style>

<script>
  const container = document.querySelector('.spotlight-container');
  container.addEventListener('mousemove', (e) => {
    const rect = container.getBoundingClientRect();
    const x = ((e.clientX - rect.left) / rect.width) * 100 + '%';
    const y = ((e.clientY - rect.top) / rect.height) * 100 + '%';
    container.style.setProperty('--x', x);
    container.style.setProperty('--y', y);
  });
</script>

				
			

Marque Rotar

HTML

				
					<div class="outer">
    <!-- This div is important! It lets us specify margin-left later on. -->
    <div>
        <div class="loop"><div class="content"> 💻 Aprende creando proyectos reales desde cero</div></div>
    </div>
</div>

<script>
document.querySelectorAll('.outer').forEach(el => {
	let content = el.querySelector('.content');

	repeatContent(content, el.offsetWidth);

	let slider = el.querySelector('.loop');
	slider.innerHTML = slider.innerHTML + slider.innerHTML;
});

    
function repeatContent(el, till) {
    let html = el.innerHTML;
    let counter = 0; // prevents infinite loop
    
    while (el.offsetWidth < till && counter < 100) {
        el.innerHTML += html;
        counter += 1;
    }
}
</script>


				
			

CCS

				
					/* Using em for your padding-left is going to ensure the padding scales in proportion to the font-size. */

.content {
    font-family: "Manrope", sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #111111;
    padding-left: 0.25em;
}

@media only screen and (max-width: 900px) {
    .content {
        font-size: 2rem !important;
        padding-left: 0.25em;
    }
}

.outer {
    overflow: hidden;  !important;
}

.outer div {
    display: inline-block;
}

.loop {
    white-space: nowrap;
    animation: loop-anim 18s linear infinite;
}

@media only screen and (max-width: 767px) {
    .loop {
        animation: loop-anim 3.7s linear infinite;
    }
}

@keyframes loop-anim {
    0% {
        margin-left: 0;
    }
    100% {
        margin-left: -40% /* This works because of the div between "outer" and "loop" */
    }
}
				
			

Botón Producto WhatsApp Single Product

Shortcode: boton_whatsapp_producto

				
					// BOTON WHATSAPP
add_shortcode( 'boton_whatsapp_producto', function() {
    $product_id = get_the_ID();
    $product = wc_get_product( $product_id );

    if ( ! $product ) return '';

    // Datos del producto
    $nombre = $product->get_name();
    $url    = get_permalink( $product_id );
    $num    = "5491125617315";
    
    // 1. Limpiamos el símbolo de moneda para que WhatsApp lo lea bien
    $simbolo_raw = get_woocommerce_currency_symbol();
    $simbolo_limpio = html_entity_decode($simbolo_raw);
    
    // 2. Formateamos el precio: 2 decimales, coma para decimal y punto para miles
    $precio_numerico = $product->get_price();
    $precio_formateado = number_format((float)$precio_numerico, 2, ',', '.');
    
    $precio_final = $simbolo_limpio . $precio_formateado;
    
    // Mensaje para Diego
    $msj = "Hola Diego, estoy interesado en el producto: *" . $nombre . "* con un precio de " . $precio_final . ". Link: " . $url;
    $url_wa = "https://wa.me/" . $num . "?text=" . urlencode($msj);

    // Botón con estilo
    return '<a href="' . $url_wa . '" target="_blank" style="background-color:#25D366; color:white; display:flex; align-items:center; justify-content:center; gap:10px; padding:15px; border-radius:8px; font-weight:bold; text-decoration:none; font-size:18px; border:none;">
        <img decoding="async" src="https://upload.wikimedia.org/wikipedia/commons/6/6b/WhatsApp.svg" width="25" height="25" style="margin:0; border:none; box-shadow:none;"> 
        Ir al Chat
    </a>';
});

				
			

Botón Compartir Producto WhatsApp Single Product

Shortcode: compartir_whatsapp_producto

				
					// BOTON COMPARTIR PRODUCTO POR WHATSAPP
add_shortcode( 'compartir_whatsapp_producto', function() {
    $product_id = get_the_ID();
    $product = wc_get_product( $product_id );

    if ( ! $product ) return '';

    // Datos del producto
    $nombre = $product->get_name();
    $url    = get_permalink( $product_id );
    
    // Mensaje sugerido que el usuario enviará a sus amigos
    $msj = "¡Mira este producto que encontré!: " . $nombre . " - " . $url;
    
    // Nota: No incluimos número de teléfono para que abra la lista de contactos
    $url_wa = "https://wa.me/?text=" . urlencode($msj);

    // Botón con estilo (Cambié el color a un tono azul o puedes mantener el verde)
    return '<a href="' . $url_wa . '" target="_blank" style="background-color:#128C7E; color:white; display:flex; align-items:center; justify-content:center; gap:10px; padding:15px; border-radius:8px; font-weight:bold; text-decoration:none; font-size:18px; border:none; margin-top:10px;">
        <img decoding="async" src="https://upload.wikimedia.org/wikipedia/commons/6/6b/WhatsApp.svg" width="25" height="25" style="margin:0; border:none; box-shadow:none;"> 
        Compartir con un amigo
    </a>';
});
				
			

Botón Compartir Producto General Single Product

Shortcode: compartir_universal

				
					// BOTON COMPARTIR MULTIPLATAFORMA (NATIVO)
add_shortcode( 'compartir_universal', function() {
    $product_id = get_the_ID();
    $product = wc_get_product( $product_id );

    if ( ! $product ) return '';

    $nombre = esc_attr( $product->get_name() );
    $url    = esc_url( get_permalink( $product_id ) );
    $msj    = "¡Mira este producto que encontré!: " . $nombre;

    // Generamos un ID único para el botón
    $btn_id = 'btn_share_' . $product_id;

    ob_start(); ?>
    
    <a href="#" id="<?php echo $btn_id; ?>" style="background-color:#007bff; color:white; display:flex; align-items:center; justify-content:center; gap:10px; padding:15px; border-radius:8px; font-weight:bold; text-decoration:none; font-size:18px; border:none; margin-top:10px;">
        <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" viewBox="0 0 16 16">
            <path d="M13.5 1a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM11 2.5a2.5 2.5 0 1 1 .603 1.628l-6.718 3.12a2.499 2.499 0 0 1 0 1.504l6.718 3.12a2.5 2.5 0 1 1-.488.876l-6.718-3.12a2.5 2.5 0 1 1 0-3.256l6.718-3.12A2.5 2.5 0 0 1 11 2.5zm-8.5 4a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm11 5.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"/>
        </svg>
        Compartir producto
    </a>

    <script>
    document.getElementById('<?php echo $btn_id; ?>').addEventListener('click', function(e) {
        e.preventDefault();
        
        // Datos a compartir
        const shareData = {
            title: '<?php echo $nombre; ?>',
            text: '<?php echo $msj; ?>',
            url: '<?php echo $url; ?>'
        };

        // Verificamos si el navegador soporta Web Share API
        if (navigator.share) {
            navigator.share(shareData)
                .then(() => console.log('Compartido con éxito'))
                .catch((err) => console.log('Error al compartir:', err));
        } else {
            // Si no es compatible (PC viejo o navegador no soportado), fallback a WhatsApp
            const waUrl = "https://wa.me/?text=" + encodeURIComponent(shareData.text + " " + shareData.url);
            window.open(waUrl, '_blank');
        }
    });
    </script>

    <?php
    return ob_get_clean();
});