Hi,
I got a little issue with the search results. The search form is used to only show posts.
It shows the results, but without the custom fields.
I use the same code to show all the posts, on the post page, and there it works fine. So I think I’m missing something.
This is the code I’m using:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="col-xs-3">
<div class="product">
<div class="image">
<?php if(get_field('prijzen')): ?>
<?php $count_blokken=0;?>
<?php while(has_sub_field('prijzen')): ?>
<?php if($count_blokken < 1): ?>
<div class="tag"><span>vanaf</span><p>€ <?php the_sub_field('prijs'); ?></p></div>
<?php $count_blokken++;?>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
<?php $image = get_field('uitgelichte_afbeelding'); ?>
<?php if( $image ): ?>
<a href="<?php the_permalink(); ?>"><img alt="<?php echo $image['alt']; ?>" src="<?php echo $image['sizes']['item-image-4']; ?>"/></a>
<?php else: ?>
<a href="<?php the_permalink(); ?>"><img src="<?php echo get_template_directory_uri(); ?>/img/geen-afbeelding-klein.jpg" alt="Alfred verhuur - <?php the_title(); ?>"></a>
<?php endif; ?>
</div>
<div class="cont">
<h4><?php the_title(); ?></h4>
<?php if(get_field('subtitel')): ?>
<span><?php the_field('subtitel'); ?></span>
<?php else: ?>
<span></span>
<?php endif; ?>
<a class="btn orange" href="<?php the_permalink(); ?>">Reserveringsaanvraag</a>
</div>
</div>
</div>
<?php endwhile; ?><?php endif; ?>
Hi @mr_marien
Please debug your code to make sure it is running as expected and to see what data is returned by the get_field
function.
Thanks
E
I have fixed the bug. It had nothing to do with the ACF field plugin.
Thanks for the quick replay though.