ACF не отображается правильно в теме wordpress двадцать четырнадцать

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

Я использую тему Twenty Fourteen. Ниже приведен цикл, в котором я разместил поля

<?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/

Я хочу, чтобы это вышло так:

Марка: KLEMM 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('имя поля') \n; Но это не работает. И как сделать так, чтобы имя поля тоже отображалось?

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

Аль Сев


person user3313684    schedule 15.02.2014    source источник


Ответы (1)


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;
?>
person Snapey    schedule 22.02.2014