Last active
December 24, 2015 11:59
-
-
Save billerickson/6795020 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 | |
/** | |
* Remove Featured Image from Feature Posts | |
* | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/code/remove-featured-image-from-feature-posts | |
* | |
*/ | |
function be_remove_image_from_features() { | |
// First, we make sure we're in the grid loop. | |
if( ! apply_filters( 'is_genesis_grid_loop', false ) ) | |
return; | |
if( in_array( 'feature', get_post_class() ) ) { | |
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); | |
remove_action( 'genesis_post_content', 'genesis_do_post_image' ); | |
} else { | |
add_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); | |
add_action( 'genesis_post_content', 'genesis_do_post_image' ); | |
} | |
} | |
add_action( 'genesis_before_entry', 'be_remove_image_from_features' ); | |
add_action( 'genesis_before_post', 'be_remove_image_from_features' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment