• I inserted the following code in the function.php file of the child Astra theme:
    if (is_singular (‘news’)) {
    $views = get_field(‘views’);
    $views++;
    update_field(‘views’,$views);
    }
    the code is not executed.
    I created a template for a single post.
    I’m trying to view the most viewed posts. But I can’t increase the value of the custom field created with ACF.
    But why doesn’t elementor integrate this simple possibility?
    Thanks

  • The topic ‘View the most viewed posts’ is closed to new replies.