gotohell2017-11-17 21:01:20
gotohell, 2017-11-17 21:01:20

Advanced Custom Fields not showing first record field?

Hello! I created additional fields in the Advanced Custom Fields plugin, everything works, but it does not display the "Height" field entry in the first publication (record)!

<?php if(get_field('article')){ echo '<li class="par"> <span class="par_name">Артикл:</span> <span class="par_option">' . get_field('article') . '</span></li>'; } ?>
<?php if(get_field('material')){ echo '<li class="par"> <span class="par_name">Материал:</span> <span class="par_option">' . get_field('material') . '</span></li>'; } ?>
<?php if(get_field('diametr')){ echo '<li class="par"> <span class="par_name">Диаметр, мм:</span> <span class="par_option">' . get_field('diametr') . '</span></li>'; } ?>
<?php if(get_field('dlina')){ echo '<li class="par"> <span class="par_name">Длина, мм:</span> <span class="par_option">' . get_field('dlina') . '</span></li>'; } ?>
<?php if(get_field('visota')){ echo '<li class="par"> <span class="par_name">Высота:</span> <span class="par_option">' . get_field('visota') . '</span></li>'; } ?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
zudogav, 2017-11-20

maybe you need to change get_field output to the_field

if($visota){ echo '<li class="par"> <span class="par_name">Высота:</span> <span class="par_option">' . $visota . '</span></li>'; } ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question