Last active
December 21, 2015 11:29
-
-
Save billerickson/6298989 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Only display Featured Image on archive | |
| * | |
| * By default, Genesis will use the first attached image if no featured | |
| * image is provided. This limits the archive to only show featured images. | |
| * | |
| * @param string $output | |
| * @param array $args | |
| * @param object $post | |
| * @return string $output | |
| */ | |
| function be_archive_featured_image_only( $output, $args, $post ) { | |
| if( 'archive' == $args['context'] && !has_post_thumbnail( $post->ID ) ) | |
| $output = ''; | |
| return $output; | |
| } | |
| add_filter( 'genesis_pre_get_image', 'be_archive_featured_image_only', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment