Remove Navigation Only On the Homepage

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.

Comments

    • Profile photo of 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.

      remove_action( 'genesis_after_header', 'genesis_do_nav' );
      remove_action( 'genesis_after_header', 'genesis_do_subnav' );
      
      • 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;
        }

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>