Skip to content

Instantly share code, notes, and snippets.

@BrianBourn

BrianBourn/functions.php

Last active Aug 29, 2015
Embed
What would you like to do?
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
You can’t perform that action at this time.