Remove Featured Image from Feature Posts

The Genesis Grid Loop plugin lets you break your blog into features (full width posts) and teasers (posts displayed in columns). This code lets you remove the featured image from features.

<?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' );
view raw functions.php hosted with ❤ by GitHub

Bill Erickson

Bill Erickson is a freelance WordPress developer and a contributing developer to the Genesis framework. For the past 14 years he has worked with attorneys, publishers, corporations, and non-profits, building custom websites tailored to their needs and goals.

Ready to upgrade your website?

I build custom WordPress websites that look great and are easy to manage.

Let's Talk