With the recent release of WordPress 3.9, several new features for theme developers were introduced to further enhance what can be baked into new WordPress themes. Devin Price has a great post over at wptheming highlighting many of the new features. The inspiration for the Genesis specific filter below came from his post.
One reason we design and build WordPress themes on the Genesis Framework is the nature in which it is built. With Genesis, I have the ability to add, filter, or remove almost everything.
Up until WordPress 3.9, the Genesis blog and archive page templates were inherited by child themes and there wasn’t a simple way to remove them. Why does this matter? When we build custom child themes for clients, we use a variety functions to remove every unnecessary item and option from Genesis to create a simplified and focused back-end for our clients.
We don’t ever use the Genesis archive template, and prefer to use the main WordPress settings and a custom home.php file for our child theme blog pages, instead of the Genesis blog template. Bill Erickson’s post here further explains the rationale for using standard WordPress template hierarchy instead of the Genesis blog template.
Removing the Blog and Archive Templates
This snippet will remove the Genesis blog and archive templates from the template chooser on the main page archive screen quick edit function and the from the individual page editor template chooser.
// Remove Blog & Archive Template From Genesis add_filter( 'theme_page_templates', 'bourncreative_remove_page_templates' ); function bourncreative_remove_page_templates( $templates ) { unset( $templates['page_blog.php'] ); unset( $templates['page_archive.php'] ); return $templates; }
Removing Blog Settings From Theme Options
Once the Genesis blog template is removed, there is no need for the blog page settings metabox on the theme settings page.
Leaving it may also be a source of confusion for clients once the site is delivered. This snippet will remove the settings metabox.
// Remove Meta Box From Theme Settings Page add_action( 'genesis_admin_before_metaboxes', 'bourncreative_remove_metaboxes' ); function bourncreative_remove_metaboxes( $hook ) { remove_meta_box( 'genesis-theme-settings-blogpage', $hook, 'main' ); }
Both code snippets should be added to your child theme’s functions.php file. Be sure to perform a full backup first, and you must be running WordPress 3.9 for it to work!
Related Posts
- Genesis Framework Frequently Asked Questions Answered
- Bourn Creative Named Genesis Recommended Developer
- How To Add a Dropdown Indicator To The Genesis 2.0 Navigation Menu Automatically
- How to Customize The Genesis 2.0 HTML5 Comment Form
- Genesis SEO Settings Guide
- How To Customize The WordPress Login Screen With Your Own Logo
- WordPress Plugins For The Genesis Framework
- The StudioPress Showcase Features Several Sites By Bourn Creative