Не отображается текст через get_field()
Хотел добавить текст к кнопкам, но не отображается ничего. На другой странице все отображается когда ссылаюсь через id (). А на главной странице куда хочу добавить текст не отрабатывает, отображается только картинка. Как можно исправить, кто знает?
вот код:
<div class="container-fluid " style="background: linear-gradient(to top left, white, grey); padding: 10px; border-radius: 3px;"> <div class="container textMonsterrat"> <div class="row featurette " style=" display: flex; align-items: center"> <div class="col" style="margin: 10px 10px 10px 10px; text-align:center; "> <h3 id="cont" class="featurette-heading"><?php get_field( 'text_box1' ); ?></h3> <a href="property.html#mech" class="btn btn-outline-dark btn-space textMonsterrat" style="margin-bottom: 5px;" role="button"> <h5 id="cont" style="margin-bottom: 0px;"><?php get_field( 'button_1' ); ?></h5> </a> <a href="property.html#temp" class="btn btn-outline-dark btn-space textMonsterrat" style="margin-bottom: 5px;" role="button"> <h5 id="cont" style="margin-bottom: 0px;"><?php get_field( 'button_2' ); ?></h5> </a> </div> <div class="col" style="margin: 10px 10px 10px 10px;"> <?php $image = get_field( 'foto_1' ); ?> <img src="<?php echo $image['url']; ?>"> </div> </div> </div> </div>
Произвольные поля в вордпрессе:
везде добавьте echo
А почему на других страницах без echo работает?
Хороший вопрос, возможно на других страницах у вас другой шаблон отрабатывает.