Ticket #25938: 25938.1.diff
File 25938.1.diff, 892 bytes (added by , 10 years ago) |
---|
-
wp-content/themes/twentyfourteen/functions.php
415 415 * Extend the default WordPress post classes. 416 416 * 417 417 * Adds a post class to denote: 418 * Non-password protected page with a post thumbnail. 418 * Non-password protected page or post, with a post thumbnail, and not outside 419 * the loop. 419 420 * 420 421 * @since Twenty Fourteen 1.0 421 422 * … … 423 424 * @return array The filtered post class list. 424 425 */ 425 426 function twentyfourteen_post_classes( $classes ) { 426 if ( ! post_password_required() && has_post_thumbnail() )427 if ( in_the_loop() && ! post_password_required() && has_post_thumbnail() ) 427 428 $classes[] = 'has-post-thumbnail'; 428 429 else 429 430 $classes[] = 'no-post-thumbnail';