diff --git a/lib/admin/admin-functions.php b/lib/admin/admin-functions.php index e4e9883..b6b67b2 100644 --- a/lib/admin/admin-functions.php +++ b/lib/admin/admin-functions.php @@ -36,6 +36,7 @@ function trestle_custom_defaults( $defaults ) { $trestle_defaults = array( 'trestle_layout' => 'solid', 'trestle_auto_nav' => 0, + 'trestle_auto_nav_depth' => 0, 'trestle_include_home_link' => 0, 'trestle_home_link_text' => __( 'Home', 'trestle' ), 'trestle_nav_button_text' => '[icon name="icon-list-ul"] ' . __( 'Navigation', 'trestle' ), @@ -91,6 +92,7 @@ function trestle_register_social_sanitization_filters() { 'absint', GENESIS_SETTINGS_FIELD, array( + 'trestle_auto_nav_depth', 'trestle_revisions_number', 'trestle_footer_widgets_number', 'trestle_equal_cols_breakpoint', @@ -156,7 +158,16 @@ function trestle_settings_box() {

- />
+ /> + +
/>

diff --git a/lib/functions/theme-functions.php b/lib/functions/theme-functions.php index b9494f1..c55f516 100644 --- a/lib/functions/theme-functions.php +++ b/lib/functions/theme-functions.php @@ -115,6 +115,7 @@ function trestle_add_mobile_nav() { function trestle_auto_nav_items( $nav_items, stdClass $menu_args ) { if ( 'primary' == $menu_args->theme_location ) { $args = array( + 'depth' => genesis_get_option( 'trestle_auto_nav_depth' ) ? genesis_get_option( 'trestle_auto_nav_depth' ) : 0, 'echo' => false, 'show_home' => ( genesis_get_option( 'trestle_include_home_link' ) && genesis_get_option( 'trestle_home_link_text' ) ) ? do_shortcode( genesis_get_option( 'trestle_home_link_text' ) ): genesis_get_option( 'trestle_include_home_link' ), 'menu_class' => 'auto-menu'