function scm_loop_page_content() { ?> <?php if (is_front_page()) { ?> <section id="featured-content" class="container hide-on-phones"> <div id="top-container" class="row"> <div id="featured"> <?php SliderContent(); ?> <?php wp_reset_postdata(); ?> </div> </div> </section> <?php } ?> <?php if (!is_front_page()) { ?> <section id="featured-content" class="container hide-on-phones"> <div id="top-container" class="row"> <div id="featured"> <?php if (has_post_thumbnail()) { the_post_thumbnail(); } ?> </div> </div> </section> <?php } ?> <div id="main-content" class="container"> <div id="content" class="row clearfix"> <?php if (is_front_page()) { ?> <div class="prev">Prev</div> <ul id="mini-banners"> <?php $i = 0; ?> <?php $loop = new WP_Query(array('post_type' => 'minibanners', 'posts_per_page' => -1, 'order' => 'ASC')); while ($loop->have_posts()) { $loop->the_post(); ?> <?php $i++; ?> <li class="mini-banner"> <?php if (has_post_thumbnail()) { the_post_thumbnail(); } ?> <div id="banner-<?php echo $i; ?> " class="banner-text"><?php the_content(); ?> </div> </li> <?php } wp_reset_postdata(); ?> </ul> <div class="next">Next</div> <?php } ?> <?php if (!is_front_page()) { ?> <div id="content-inner"> <h1><?php the_title(); ?> </h1> <?php the_content(); ?> <?php $posts = get_field('accordion_relationship'); if ($posts) { ?> <div id="accordion-section" class="accordion"> <?php foreach ($posts as $post) { // variable must be called $post (IMPORTANT) ?> <?php setup_postdata($post); ?> <h3><?php the_field('accordion_title', $post->ID); ?> </h3> <div class="accordion-inner"><?php the_content(); ?> </div> <?php } ?> </div> <?php wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly ?> <?php } ?> </div> <?php } ?> </div> </div> <?php }
<?php /* Template Name: Orbit */ get_header(); ?> <div class="row"> <div class="eight columns centered"> <div id="featured"> <?php SliderContent(); ?> </div> </div> </div> <?php get_footer();