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/functions.php

    r25971 r25979  
    6969
    7070    // Add several sizes for Post Thumbnails.
     71    add_image_size( 'post-thumbnail-slider', 1038, 576, true );
    7172    add_image_size( 'post-thumbnail-grid', 672, 372, true );
    7273    add_image_size( 'post-thumbnail', 672, 0 );
     
    220221 */
    221222function twentyfourteen_scripts() {
    222 
    223223    // Add Lato font, used in the main stylesheet.
    224     wp_enqueue_style( 'twentyfourteen-lato' );
     224    wp_enqueue_style( 'twentyfourteen-lato', twentyfourteen_font_url(), array(), null );
    225225
    226226    // Add Genericons font, used in the main stylesheet.
     
    239239        wp_enqueue_script( 'jquery-masonry' );
    240240
     241    if ( 'slider' == get_theme_mod( 'featured_content_layout' ) )
     242        wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20131028', true );
     243
    241244    wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20131011', true );
    242 
    243     // Add Lato font used in the main stylesheet.
    244     wp_enqueue_style( 'twentyfourteen-lato', twentyfourteen_font_url(), array(), null );
    245245}
    246246add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' );
     
    366366 * 5. Presence of footer widgets.
    367367 * 6. Single views.
     368 * 7. Featured content layout.
    368369 *
    369370 * @since Twenty Fourteen 1.0
     
    396397        $classes[] = 'singular';
    397398
     399    if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) )
     400        $classes[] = 'slider';
     401    elseif ( is_front_page() )
     402        $classes[] = 'grid';
     403
    398404    return $classes;
    399405}
Note: See TracChangeset for help on using the changeset viewer.