twentyfourteen_post_classes

Extend the default WordPress post classes.

Description

(array) twentyfourteen_post_classes( (array) $classes ); 

Adds a post class to denote: Non-password protected page with a post thumbnail.

Returns (array)

The filtered post class list.

Parameters (1)

0. $classes (array)
A list of existing post class values.

Usage

  1. if ( !function_exists( 'twentyfourteen_post_classes' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // A list of existing post class values. 
  5. $classes = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = twentyfourteen_post_classes($classes); 
  9.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function twentyfourteen_post_classes( $classes ) { 
  2. if ( ! post_password_required() && has_post_thumbnail() ) { 
  3. $classes[] = 'has-post-thumbnail'; 
  4.  
  5. return $classes;