-
-
Save braddalton/5872294 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
add_action( 'genesis_before_post' , 'wps_no_featured_image' ); | |
add_action( 'genesis_after_post_content' , 'wps_no_featured_image' ); | |
/* | |
* Remove featured image from certain posts. | |
* | |
* Stops featured image from displayed on the Small Group Show category (126) on | |
* the blog page. | |
* | |
* @author Travis Smith | |
* @link http://wpsmith.net/2012/genesis/how-to-hide-the-featured-image-of-a-specific-category-on-the-blog-page-in-genesis/ | |
* | |
* @global stdClass $post Post object. | |
* | |
* @return null Returns early if post is not in our chosen category. | |
*/ | |
function wps_no_featured_image() { | |
global $post; | |
if ( ! has_category( 126, $post ) ) | |
return; | |
if ( 'genesis_before_post' == current_filter() ) | |
remove_action( 'genesis_post_content', 'genesis_do_post_image' ); | |
elseif ( 'genesis_after_post_content' == current_filter() ) | |
add_action( 'genesis_before_post_content', 'genesis_do_post_image' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment