Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Front Page
- *
- * Magazine layout with several loop areas and a featured content area (slider). This template must be manually set for a page. Then the same page can be set as a Front page from Settings -> Reading -> Front page displays -> A static page.
- *
- * @package Oxygen
- * @subpackage Template
- */
- /* Set up a default array for posts we're not duplicating. */
- $do_not_duplicate = array();
- get_header(); // Loads the header.php template. ?>
- <?php
- /**
- * Featured Content (slider)
- *
- */
- $args = array( 'posts_per_page' => 6 );
- $loop = new WP_Query( $args );
- if ( $loop->have_posts() ) : ?>
- <div class="featured-wrapper">
- <div id="featured-content">
- <img class="dummy <?php echo ( $loop->post_count == 1 ) ? 'hidden' : ''; ?>" src="<?php echo get_template_directory_uri() . '/images/empty.gif' ?>" alt="" width="750" height="380" />
- <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
- <?php $do_not_duplicate[] = get_the_ID(); ?>
- <div class="featured-post">
- <?php if ( current_theme_supports( 'get-the-image' ) ) get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'featured-thumbnail' ) ); ?>
- <?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>
- <?php echo apply_atomic_shortcode( 'byline', '<div class="byline">' . __( '[entry-published]', 'oxygen' ) . '</div>' ); ?>
- </div> <!-- .featured-post -->
- <?php endwhile; ?>
- <span id="slider-prev" class="slider-nav">←</span>
- <span id="slider-next" class="slider-nav">→</span>
- </div><!-- #featured-content -->
- <div id="slider-nav">
- <ul id="slide-thumbs">
- <?php $slidecount = 1;
- $args = array( 'post__not_in' => get_option( 'sticky_posts' ) );
- while ( $loop->have_posts() ) : $loop->the_post(); ?>
- <?php $do_not_duplicate[] = get_the_ID(); ?>
- <li class="<?php echo ( $slidecount == 6 ) ? 'last' : ''; ?>">
- <?php if ( current_theme_supports( 'get-the-image' ) ) get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'slider-nav-thumbnail' ) ); ?>
- </li>
- <?php $slidecount++; ?>
- <?php endwhile; ?>
- </ul>
- </div><!-- #slider-nav-->
- </div><!-- .featured-wrapper-->
- <?php endif; ?>
- <div class="aside">
- <?php get_template_part( 'menu', 'secondary' ); // Loads the menu-secondary.php template. ?>
- <?php get_sidebar( 'primary' ); // Loads the sidebar-primary.php template. ?>
- </div>
- <?php do_atomic( 'before_content' ); // oxygen_before_content ?>
- <div class="content-wrap">
- <div id="content">
- <?php do_atomic( 'open_content' ); // oxygen_open_content ?>
- <div class="hfeed">
- <h4 class="section-title"><?php _e( 'Recent Articles', 'oxygen' ); ?></h4>
- <?php $args = array( 'post__not_in' => $do_not_duplicate, 'posts_per_page' => 3 ); ?>
- <?php $loop = new WP_Query( $args ); ?>
- <?php if ( $loop->have_posts() ) : ?>
- <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
- <?php do_atomic( 'before_entry' ); // oxygen_before_entry ?>
- <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
- <?php do_atomic( 'open_entry' ); // oxygen_open_entry ?>
- <?php if ( current_theme_supports( 'get-the-image' ) ) {
- get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'archive-thumbnail', 'image_class' => 'featured', 'width' => 470, 'height' => 140, 'default_image' => get_template_directory_uri() . '/images/archive-thumbnail-placeholder.gif' ) );
- } ?>
- <div class="entry-header">
- <?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>
- <?php echo apply_atomic_shortcode( 'byline_date', '<div class="byline byline-date">' . __( '[entry-published]', 'oxygen' ) . '</div>' ); ?>
- <?php echo apply_atomic_shortcode( 'byline_edit', '<div class="byline byline-edit">' . __( '[entry-edit-link]', 'oxygen' ) . '</div>' ); ?>
- </div>
- <?php echo apply_atomic_shortcode( 'byline_category', '<div class="byline byline-cat">' . __( '[entry-terms taxonomy="category" before=""]', 'oxygen' ) . '</div>' ); ?>
- <div class="entry-summary">
- <?php the_excerpt(); ?>
- <?php wp_link_pages( array( 'before' => '<p class="page-links">' . __( 'Pages:', 'oxygen' ), 'after' => '</p>' ) ); ?>
- </div>
- <a class="read-more" href="<?php the_permalink(); ?>"><?php _e( 'Read Article', 'oxygen' ); ?> →</a>
- <?php do_atomic( 'close_entry' ); // oxygen_close_entry ?>
- </div><!-- .hentry -->
- <?php do_atomic( 'after_entry' ); // oxygen_after_entry ?>
- <?php endwhile; ?>
- <?php else : ?>
- <?php get_template_part( 'loop-error' ); // Loads the loop-error.php template. ?>
- <?php endif; ?>
- <h4 class="section-title"><?php _e( 'More Articles', 'oxygen' ); ?></h4>
- <div class="hfeed-more">
- <?php $args = array( 'post__not_in' => $do_not_duplicate, 'posts_per_page' => 6, 'offset' => 3); ?>
- <?php $loop = new WP_Query( $args ); ?>
- <?php if ( $loop->have_posts() ) : ?>
- <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
- <?php $do_not_duplicate[] = get_the_ID(); ?>
- <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
- <?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>
- <?php echo apply_atomic_shortcode( 'byline', '<div class="byline">' . __( '[entry-published] / in [entry-terms taxonomy="category"] [entry-edit-link before=" / "]', 'oxygen' ) . '</div>' ); ?>
- </div><!-- .hentry -->
- <?php endwhile; ?>
- <?php else : ?>
- <?php get_template_part( 'loop-error' ); // Loads the loop-error.php template. ?>
- <?php endif; ?>
- </div><!-- .hfeed-more -->
- </div><!-- .hfeed -->
- <?php do_atomic( 'close_content' ); // oxygen_close_content ?>
- </div><!-- #content -->
- <?php do_atomic( 'after_content' ); // oxygen_after_content ?>
- <?php get_footer(); // Loads the footer.php template. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement