Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Front Page with full width sections.
- *
- * @author Sridhar Katakam
- * @license GPL-2.0+
- */
- // Display header
- get_header();
- // Display Homepage Flexible Content
- // check if the flexible content field has rows of data
- if( have_rows('hero_section') ) {
- // loop through the rows of data
- while ( have_rows('hero_section') ) : the_row();
- if( get_row_layout() == 'hero_section' ) {
- $image = get_sub_field( 'hero_image' );
- echo '<section class="row hero"><img src="' . $image['url'] . '" alt="' . $image['alt'] . '" /><div class="hero-content wrap">'. get_sub_field( 'hero_overlay_content' ) .'</div></section>';
- }
- endwhile;
- }
- else {
- // no layouts found
- }
- genesis_widget_area( 'below-hero', array(
- 'before' => '<div class="below-hero widget-area"><div class="wrap">',
- 'after' => '</div></div>',
- ) );
- // Testimonials Slider Begin
- // WP_Query arguments
- $args = array (
- 'post_type' => 'testimonial',
- 'posts_per_page' => '4',
- );
- // The Query
- $query = new WP_Query( $args );
- // The Loop
- if ( $query->have_posts() ) {
- echo '<div class="testimonials-slider"><div class="wrap"><h3 class="testimonials-title">What People are Saying</h3><div class="testimonial-items">';
- while ( $query->have_posts() ) {
- $query->the_post();
- // each loop item
- $byline = esc_attr( get_post_meta( get_the_ID(), '_byline', true ) );
- ?>
- <div class="testimonial-item">
- <div class="left"><?php genesis_image( array( 'size' => 'testimonial-thumb' ) ); ?></div>
- <div class="right">
- <div class="testimonial-content"><?php the_content(); ?></div>
- <div class="testifier"><?php the_title(); ?></div>
- <?php echo $byline; ?>
- </div>
- </div>
- <?php }
- echo '</div></div></div>';
- } else {
- // no posts found
- }
- // Restore original Post Data
- wp_reset_postdata();
- // Testimonials Slider End
- // Blog Posts
- // accepts any wp_query args
- $args = (array(
- 'posts_per_page' => 3
- ));
- echo '<div class="blog-posts"><div class="wrap"><h2 class="recent-posts-title">Recent Posts</h2>';
- genesis_custom_loop( $args );
- echo '<div class="browse-archive"><a href="/blog/" class="button">Read the Blog</a></div></div></div>';
- // Products Slider Begin
- // WP_Query arguments
- $args = array (
- 'post_type' => 'download',
- 'posts_per_page' => '4',
- 'tax_query' => array(
- array(
- 'taxonomy' => 'download_category',
- 'field' => 'slug',
- 'terms' => 'featured',
- ),
- ),
- );
- // The Query
- $query = new WP_Query( $args );
- // The Loop
- if ( $query->have_posts() ) {
- echo '<div class="products-slider"><div class="wrap"><h3 class="products-title">Featured Product</h3><div class="products">';
- while ( $query->have_posts() ) {
- $query->the_post();
- // each loop item
- ?>
- <div class="product">
- <div class="left"><a href="<?php the_permalink(); ?>"><?php genesis_image( array( 'size' => 'product-thumb' ) ); ?></a></div>
- <div class="right">
- <div class="product-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
- <div class="product-content"><?php the_content(); ?></div>
- </div>
- </div>
- <?php }
- echo '</div></div></div>';
- } else {
- // no posts found
- }
- // Restore original Post Data
- wp_reset_postdata();
- // Products Slider End
- genesis_widget_area( 'home-above-footer', array(
- 'before' => '<div class="home-above-footer widget-area">',
- 'after' => '</div>',
- ) );
- // Display Footer
- get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement