option_generate_secondary_nav_settings

The option_generate_secondary_nav_settings filter allows you to filter the options in our Secondary Nav add-on.

These options are all available in the customizer. The filters allow you to change the setting under certain conditions.

Available Options

Return Value

$options[‘secondary_nav_mobile_label’]

Set the text of your secondary mobile menu label.

'My custom secondary mobile menu label'

$options[‘secondary_nav_layout_setting’]

Set the outer container width of secondary navigation.

'secondary-fluid-nav' //full
'secondary-contained-nav' //contained

$options[‘secondary_nav_inner_width’]

Set the inner container width of secondary navigation.

'full-width' //full
'contained' //contained

$options[‘secondary_nav_alignment’]

Set the alignment of secondary navigation.

'left'
'center'
'right'

$options[‘secondary_nav_position_setting’]

Set the position of secondary navigation.

'secondary-nav-below-header'
'secondary-nav-above-header'
'secondary-nav-float-right'
'secondary-nav-float-left'
'secondary-nav-left-sidebar'
'secondary-nav-right-sidebar'
''//no navigation

$options[‘merge_top_bar’]

Merge secondary navigation with top bar widget area when it’s set to above header

'true'
'false'

Example

If we want to use different settings for single posts:

add_filter( 'option_generate_secondary_nav_settings','lh_single_posts_secondary_nav_settings' );
function lh_single_posts_secondary_nav_settings( $options ) {
    if ( is_single() ) {
        $options['secondary_nav_position_setting'] = 'secondary-nav-above-header';
        $options['secondary_nav_alignment'] = 'center';
    }
    
    return $options;
}