/* 
Theme Name: Hello Elementor Child
Theme URI: https://github.com/elementor/hello-theme/
Description: Hello Elementor Child is a child theme of Hello Elementor, created by Elementor team
Author: Elementor Team
Author URI: https://elementor.com/
Template: hello-elementor
Version: 1.0.1
Text Domain: hello-elementor-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/

/*
    Add your custom styles here

function emcotia_increment_post_views() {
    // Verifica se é página de single post, single page ou custom post type
    if ( ! is_singular() ) {
        return;
    }

    global $post;
    if ( empty( $post ) ) {
        return;
    }

    $post_id = $post->ID;

    // Pega a contagem atual do campo personalizado
    $views = get_post_meta( $post_id, '_contador-de-views', true );

    if ( ! $views ) {
        $views = 0;
    }

    // Incrementa em +1
    $views++;

    // Atualiza o valor do meta
    update_post_meta( $post_id, '_contador-de-views', $views );
}
add_action( 'wp_head', 'emcotia_increment_post_views' );

*/
