add_filter('genesis_options', 'gt_no_nav_home', 10, 2); function gt_no_nav_home($options, $setting) { if($setting == GENESIS_SETTINGS_FIELD) { if ( is_home() ) { $options['nav'] = 0; $options['subnav'] = 0; } } return $options; }
This snippet was requested by the “Suggest a Tutorial ” form in the right side of the site. If you have an idea for a tutorial or a snippet please suggest something.
Sheila Bergman says
I’m having trouble making this work on the Venture child theme. I’ve pasted your code into the top of my home.php file as below but with no effect. http://www.mervbergman.net/ . Please advise. Thanks.
Christopher says
With an actual home.php file you can simply add the following lines to your template file to remove the navs. Since the code will only be in home.php it will only run on home.php.
Sheila Bergman says
Thanks. I cut and pasted that code into home.php and it had no effect. The nav is still there. This comment box doesn’t seem to allow code or I would show you.
Sheila Bergman says
I see that in the Venture child theme, the nav div is nested inside of the header. Is there a hook that accounts for that?
Sheila Bergman says
This code from the folks at StudioPress solved my problem:
/** remove navigation from home */
add_filter(‘genesis_options’, ‘gt_no_nav_home’, 10, 2);
function gt_no_nav_home($options, $setting) {
if($setting == GENESIS_SETTINGS_FIELD) {
if ( is_home() ) {
$options[‘nav’] = 0;
$options[‘subnav’] = 0;
}
}
return $options;
}