WordPress 3.9 filter to remove the blog and archive page templates from Genesis, and function to remove the Genesis theme settings blog metabox
This file contains 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
<?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