Support

Account

Home Forums General Issues All fields from one field group in one frontent array? Reply To: All fields from one field group in one frontent array?

  • <?php
                            $args = array( 'post_type' => 'company', 'posts_per_page' => 15 );
                            $loop = new WP_Query( $args );
                            while ( $loop->have_posts() ) : $loop->the_post(); ?>
                            <div class="boxy">
                            <div class="acf_company_name">
                            <h5>Company Name: </h5>
                            <p><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_field('company_name'); ?></a></p>
                            </div>
                            <div class="acf_full_name">
                            <h5>Full Name: </h5>
                            <?php the_field('full_name'); ?>
                            </div>
                            <div class="acf_vat">
                            <h5>VAT: </h5>
                            <?php the_field('vat'); ?>
                            </div>
                            <div class="acf_email">
                            <h5>E-mail: </h5>
                            <a href="mailto:<?php the_field('email'); ?>"><?php the_field('email'); ?></a>
                            </div>
                            <div class="acf_website">
                            <h5>Official website: </h5>
                            <?php the_field('website'); ?>
                            </div>
                            <?php if ( get_field('logo_company') ) : ?>
                            <div class="acf_logo_company"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php $image = get_field(logo_company); ?>
    
                            <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" /></a></div>
                            <?php endif; ?>
    
                            <div class="acf_company_location"><?php $location = get_field('company_location');?>
    
                            <div class="acf-map">
    	                        <div class="marker" data-lat="<?php echo $location['lat']; ?>" data-lng="<?php echo $location['lng']; ?>" data-lng="<?php echo $location['address']; ?>"></div>
                            </div></div>
                            <div class="acf_company_location">
                            <h5>Company location: </h5>
                            <?php the_field('company_location'); ?>
                            </div>
                            </div>
                            <?php endwhile; ?>