/*
Theme Name: Organio Child
Theme URI: http://demo.casethemes.net/organio/
Author: Case-Themes
Author URI: https://themeforest.net/user/case-themes/portfolio/
Description: Organio is a beautiful, modern, and responsive Organic Food Store WordPress Theme. Organio is a perfect fit for any natural food related website like fresh grocer, market food, grocery market, organic ecommerce website, organic food store, Organic markets, supermarkets and online groceries. Additionally, it is perfect for eco product stores, fresh breads, bakery shops and even natural cosmetics stores.  
Version: 1.6.1
License: ThemeForest
License URI: https://themeforest.net/licenses
Template: organio
Text Domain: organio-child
Tags: organic, organic theme, organic store, organic food store, organic shop, organic farm, food, farm, store, nutrition, fruit, woocommerce, fresh, vegetable
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/
function ocultar_comentarios_y_traducir() {
    ?>
    <script>
    document.addEventListener("DOMContentLoaded", function() {
        // Traduce Entradas Recientes
        document.querySelectorAll(".widget h2, .widget-title, .sidebar h2, h2.widget-title").forEach(function(el) {
            if (el.textContent.trim() === "Recent Posts") {
                el.textContent = "Entradas recientes";
            }
        });
        
        // Oculta el bloque completo de Comentarios Recientes por su clase del tema
        document.querySelectorAll(".widget_recent_comments").forEach(function(el) {
            el.style.display = "none";
        });
    });
    </script>
    <?php
}
add_action('wp_footer', 'ocultar_comentarios_y_traducir');
function ocultar_autor_y_comentarios_total() {
    ?>
    <style>
        /* Oculta el autor, la fecha y metadatos de las entradas */
        .entry-meta, .post-author, .date-author, .single-meta, span.author, .byline, .post-date, .entry-author, .post-meta, li:has(> .fa-user) {
            display: none !important;
        }
        /* Oculta la sección de comentarios por completo */
        #comments, .comments-area, .comment-respond, .widget_recent_comments {
            display: none !important;
        }
    </style>
    <?php
}
