Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save damiencarbery/2d7ae4e29b8728cb3e2c246a67693f53 to your computer and use it in GitHub Desktop.
Save damiencarbery/2d7ae4e29b8728cb3e2c246a67693f53 to your computer and use it in GitHub Desktop.
Remove the hero image and avatar from single posts in Monochrome Pro theme.
<?php
/*
Plugin Name: Monochrome Pro - remove hero and avatar
Plugin URI: https://www.facebook.com/groups/genesiswp/posts/8077692698948523/
Description: Remove the hero image and avatar from single posts in Monochrome Pro theme.
Author: Damien Carbery
Version: 0.1
*/
// Remove hero image.
add_action( 'genesis_after_header', 'remove_monochrome_entry_background_post', 1 );
function remove_monochrome_entry_background_post() {
remove_action( 'genesis_after_header', 'monochrome_entry_background_post' );
}
// Remove avatar.
add_action( 'genesis_entry_header', 'remove_monochrome_gravatar_post', 5 );
function remove_monochrome_gravatar_post() {
remove_action( 'genesis_entry_header', 'monochrome_gravatar_post', 7 );
}
// Remove negative margin-top as hero image removed.
add_action( 'wp_head', 'remove_negative_margin_top' );
function remove_negative_margin_top() {
?>
<style>
.full-width-content.featured-image .site-inner { margin-top: 100px; }
</style>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment