2014-02-15 9 views
0

Я пытаюсь настроить сообщение и установить плагин Advanced Custom Field. Пользовательское поле отображается в редакторе, но когда я добавляю все поля the_field ('fieldname') на одну страницу сообщения, оно отображается в сообщении, но все они находятся в одной строке.ACF не отображается правильно в wordpress двадцать четырнадцатая тема

Тема, которую я использую, - двадцать четырнадцать. Ниже петли были я поместил полях

<?php 
      // Start the Loop. 
      while (have_posts()) : the_post(); 


      get_template_part('content', get_post_format()); 
      the_field('make'); 
      the_field('type'); 
      the_field('year'); 
      the_field('hours'); 
      the_field('location'); 
      the_field('specifications'); 

      // Previous/next post navigation. 
      twentyfourteen_post_nav(); 

      // If comments are open or we have at least one comment, load up the comment template. 
      if (comments_open() || get_comments_number()) { 
          comments_template(); 
         } 
      endwhile; 
    ?> 

Он выходит, как это на пост: http://www.hamburgheros.com/2014/02/12/klemm-kr-909-1/

Я хочу, чтобы выйти, как это:

Марка: Клемм KR 909-1 Тип: Сверла Год: 2012 часы: 100 Откуда: Германия Спецификации: многоцелевой/Якорь буровой установки

Deutz Engine TCD 2013 L4 2V – 129 KW/175 HP (EPA/TIERIII) 
Crawler type B1/400 mm 3-grouser pads 
Drill mast type 305 
Hammer KD1624 
Different options for double head drilling units and rotary heads 
Different options for clamping and breaking devices 
Remote controlled drilling functions 
Second articulation cylinder 
Winch 
Flushing 1”/1 ½ “ 
Oiler 8 l, 20 bar 
Weight: 13 t 

Я попробовал the_field ('field name') \ n; Но это не работает. И как вы это делаете, имя поля также появляется?

Пожалуйста, помогите, я буду очень признателен.

Al Sev

ответ

0

the_field возвращает только данные, связанные с записью - вы должны добавить лейблы себя наряду с некоторыми HTML для стиля вывода, например;

<?php 
     // Start the Loop. 
     while (have_posts()) : the_post(); 


     get_template_part('content', get_post_format()); 

     ?> 
     <ul> 
      <li>MAKE: <?php the_field('make'); ?></li> 
      <li>TYPE: <?php the_field('type'); ?></li> 
      <li>YEAR: <?php the_field('year'); ?></li> 
      <li>HOURS: <?php the_field('hours'); ?></li> 
      <li>LOCATION: <?php the_field('location'); ?></li> 
      <li>SPEC: <?php the_field('specifications'); ?></li> 
     </ul> 

     // Previous/next post navigation. 
     twentyfourteen_post_nav(); 

     // If comments are open or we have at least one comment, load up the comment template. 
     if (comments_open() || get_comments_number()) { 
         comments_template(); 
        } 
     endwhile; 
?> 
+0

Спасибо Snapey, вы подтвердили, что я думал делать. – user3313684

Смежные вопросы