Here’s the code from the ACF Relationship Field example adapted to your field name. I edited out some of the markup just to simplify things.
A couple of notes:
-
Use a proper text editor and indent your code so it is readable. A soup of random indentation makes it much more difficult to debug code.
-
The ACF Relationship Field lets you associate multiple posts in a single field, so having 5 or 10 different fields is unnecessary and just adds extra queries.
.
<?php
$posts = get_field('locul_1');
if( $posts ):
foreach( $posts as $post): // variable must be called $post (IMPORTANT) ?>
<?php setup_postdata($post); ?>
<div class="bi">
<div class="bi-img">
<a href="https://wordpress.stackexchange.com/questions/83040/<?php the_permalink(); ?>">
<img src="/scripts/timthumb.php?src=<?php the_field('img'); ?>&h=55&w=40&zc=1" alt="<?php the_title_attribute(); ?>" title="<?php the_title_attribute(); ?>"/>
</a>
</div>
</div>
<?php
endforeach;
wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly
endif;