Skip to content

Instantly share code, notes, and snippets.

@BrianBourn
Last active August 29, 2015 13:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrianBourn/10209582 to your computer and use it in GitHub Desktop.
Save BrianBourn/10209582 to your computer and use it in GitHub Desktop.
WordPress 3.9 filter to remove the blog and archive page templates from Genesis, and function to remove the Genesis theme settings blog metabox
<?php //Do not include opening php tag
add_filter( 'theme_page_templates', 'bourncreative_remove_page_templates' );
/**
* Remove Genesis blog and archive templates from page templates dropdown.
*
* @author Brian Bourn
* @link http://www.bourncreative.com/remove-genesis-blog-archive-page-templates/
*
* @param array $templates List of templates.
*
* @return array Amended list of templates.
*/
function bourncreative_remove_page_templates( $templates ) {
unset( $templates['page_blog.php'] );
unset( $templates['page_archive.php'] );
return $templates;
}
add_action( 'genesis_admin_before_metaboxes', 'bourncreative_remove_metaboxes' );
/**
* Remove Genesis blog settings metabox from theme settings page.
*
* @author Brian Bourn
* @link http://www.bourncreative.com/remove-genesis-blog-archive-page-templates/
*
*
*/
function bourncreative_remove_metaboxes( $hook ) {
remove_meta_box( 'genesis-theme-settings-blogpage', $hook, 'main' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment