Skip to content

Instantly share code, notes, and snippets.

@damiencarbery
Created May 22, 2019 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save damiencarbery/59c9e18872eb0bc56b4894d288ccea36 to your computer and use it in GitHub Desktop.
Save damiencarbery/59c9e18872eb0bc56b4894d288ccea36 to your computer and use it in GitHub Desktop.
Remove the entry-header area on pages. Do not change single posts or archives
<?php
/*
Plugin Name: Remove page title (Genesis)
Plugin URI: http://www.damiencarbery.com
Description: Remove the entry-header section (with page title, post info and featured image) from pages but not posts or archives.
Author: Damien Carbery
Version: 0.1
*/
add_action( 'genesis_before_entry', 'dcwd_remove_page_title' );
function dcwd_remove_page_title() {
if ( is_page() ) {
remove_action( 'genesis_entry_header', 'genesis_do_post_format_image', 4 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment