Last active
December 10, 2015 23:48
-
-
Save billerickson/4511884 to your computer and use it in GitHub Desktop.
This file contains 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 | |
// Our large image size | |
add_image_size( 'be_large', 500, 500, true ); | |
/** | |
* Genesis Grid - Use different image on CPT archive | |
* | |
* @author Bill Erickson | |
* @link http://wordpress.org/support/topic/filter-the-image-for-cpt-archive | |
* | |
* @param string $image_size | |
* @return string | |
*/ | |
function be_cpt_image_size( $image_size ) { | |
// Only run on the 'image' post type archive | |
if( !is_post_type_archive( 'image' ) ) | |
return $image_size; | |
if( in_array( 'feature', get_post_class() ) ) | |
$image_size = 'be_large'; | |
return $image_size; | |
} | |
add_filter( 'genesis_pre_get_option_image_size', 'be_cpt_image_size', 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment