Make WordPress Core


Ignore:
Timestamp:
10/29/2013 04:28:11 PM (11 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: implement an alternate "slider" view for home page featured content. Props iamtakashi for the design and implementation. Slider JavaScript code adapted from FlexSlider v2.2.0 props WooThemes and mbmufffin. See #25550.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/content-featured-post.php

    r25971 r25979  
    1010
    1111<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    12     <a class="attachment-featured-featured" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>">
    13         <?php
    14             if ( has_post_thumbnail() ) :
     12    <a class="post-thumbnail" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>">
     13    <?php
     14        if ( has_post_thumbnail() ) :
     15            if ( 'grid' == get_theme_mod( 'featured_content_layout' ) )
    1516                the_post_thumbnail( 'post-thumbnail-grid' );
    16 
    17             else :
    18                 $images = get_children( array(
    19                     'post_parent'    => get_the_ID(),
    20                     'post_type'      => 'attachment',
    21                     'post_mime_type' => 'image',
    22                     'orderby'        => 'menu_order',
    23                     'order'          => 'ASC',
    24                     'numberposts'    => 1,
    25                 ) );
    26 
    27                 if ( $images ) :
    28                     $image = array_shift( $images );
    29                     echo wp_get_attachment_image( $image->ID, 'post-thumbnail-grid' );
    30                 endif;
    31             endif;
    32         ?>
     17            else
     18                the_post_thumbnail( 'post-thumbnail-slider' );
     19        endif;
     20    ?>
    3321    </a>
    3422
    35     <div class="entry-wrap">
    36         <header class="entry-header">
    37             <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
    38             <div class="entry-meta">
    39                 <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span>
    40             </div><!-- .entry-meta -->
    41             <?php endif; ?>
     23    <header class="entry-header">
     24        <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) &&twentyfourteen_categorized_blog() ) : ?>
     25        <div class="entry-meta">
     26            <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span>
     27        </div><!-- .entry-meta -->
     28        <?php endif; ?>
    4229
    43             <?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); ?>
    44         </header><!-- .entry-header -->
    45     </div>
     30        <?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">','</a></h1>' ); ?>
     31    </header><!-- .entry-header -->
    4632</article><!-- #post-## -->
Note: See TracChangeset for help on using the changeset viewer.