Make WordPress Core


Ignore:
Timestamp:
10/08/2013 09:21:19 PM (12 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: allow pages to have featured images, props iamtakashi. Fixes #25325.

File:
1 edited

Legend:

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

    r25624 r25735  
    6060
    6161    // Enable support for Post Thumbnails.
    62     add_theme_support( 'post-thumbnails', array( 'post' ) );
     62    add_theme_support( 'post-thumbnails' );
    6363
    6464    // Adding several sizes for Post Thumbnails.
     
    482482
    483483/**
     484 * Extends the default WordPress post classes.
     485 *
     486 * Adds a post class to denote:
     487 * Non-password protected page with a featured image.
     488 *
     489 * @param array $classes A list of existing post class values.
     490 * @return array The filtered post class list.
     491 */
     492function twentyfourteen_post_classes( $classes ) {
     493    if ( ! post_password_required() && has_post_thumbnail() )
     494        $classes[] = 'has-featured-image';
     495
     496    return $classes;
     497}
     498add_filter( 'post_class', 'twentyfourteen_post_classes' );
     499
     500/**
    484501 * Creates a nicely formatted and more specific title element text for output
    485502 * in head of document, based on current view.
Note: See TracChangeset for help on using the changeset viewer.