Dont use query_posts
or WP_Query
if you need it in the main loop. Dont ever use query_posts
anyway.
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php $current_id = get_the_ID(); ?>
<?php echo $current_id ?>
<h1><?php the_field('titleFart', $current_id); ?></h1>
<?php endwhile; // end of the loop. ?>
<?php endif; ?>
Because: get_the_ID()