ACF - Output loop

<?php /** * Template Name: Careers * * @package Linney Group * @author John Holt Ripley <johnholtripley@linney.com> & Shaun Saward <shaunsaward@linney.com> * @copyright Copyright (c) 2013, Linney Digital * @since 1.1 */ ?> <?php get_header(); ?> <?php add_filter('the_content','wpautop'); ?> <div class="carouselWrapper"> <div id="slider"> <ul> <li id="carouselCareers"> <div></div> </li> </ul> </div> </div> <?php $careers_args = array( 'post_type' => 'careers', 'posts_per_page' => '-1', 'orderby' => 'date', 'order' => 'DESC', 'post_status' => 'publish' ); $careers_query = new WP_Query($careers_args); ?> <div class="two-thirds column"> <?php if(have_posts()): while(have_posts()): the_post(); ?> <?php the_content(); ?> <?php endwhile; endif; ?> </div> <ul class="linkList" id="top"> <?php if($careers_query->have_posts()): ?> <?php $i=0; while($careers_query->have_posts()): $careers_query->the_post(); ?> <?php $field = get_field_object('career_business'); $value = get_field('career_business'); $label = $field['choices'][ $value ]; ?> <li><a href="<?php the_permalink(); ?>"><span><?php the_title(); ?></span> <?php echo $label; ?></a></li> <?php endwhile; ?> <?php endif; ?> </ul> <?php get_footer(); ?>

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.