Added menu description option for main menu
This commit is contained in:
parent
a1f515e0ae
commit
e562483d85
@ -921,6 +921,20 @@ $default_copyright = '<a rel="license" href="http://creativecommons.org/licenses
|
||||
'label' => __( 'Excerpt length in number of words (maximum = 100)', 'atticus-finch' ),
|
||||
) );
|
||||
|
||||
|
||||
$wp_customize->add_setting( 'atticus_finch_main_menu_desc', array(
|
||||
'type' => 'theme_mod',
|
||||
'transport' => 'postMessage',
|
||||
'default' => '1',
|
||||
'sanitize_callback' => 'atticus_finch_sanitize_checkbox',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( 'atticus_finch_main_menu_desc', array(
|
||||
'section' => 'atticus_finch_misc',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Show menu item descriptions in main menu', 'atticus-finch' ),
|
||||
) );
|
||||
|
||||
// Preview some of our options
|
||||
/*
|
||||
if ( $wp_customize->is_preview() && ! is_admin() )
|
||||
|
18
header.php
18
header.php
@ -81,7 +81,9 @@
|
||||
<?php $walker = new Atticus_Finch_Menu_With_Description; ?>
|
||||
|
||||
<nav id="primary-menu">
|
||||
<?php wp_nav_menu( array(
|
||||
<?php
|
||||
if ( get_theme_mod( 'atticus_finch_main_menu_desc' ) == 1 ) {
|
||||
$array = array(
|
||||
'theme_location' => 'primary-menu',
|
||||
'fallback_cb' => '',
|
||||
'menu_class' => 'sf-menu',
|
||||
@ -90,7 +92,19 @@
|
||||
'container_id' => 'belowheadermenu',
|
||||
'depth' => 3,
|
||||
'walker' => $walker,
|
||||
) );
|
||||
);
|
||||
} else {
|
||||
$array = array(
|
||||
'theme_location' => 'primary-menu',
|
||||
'fallback_cb' => '',
|
||||
'menu_class' => 'sf-menu',
|
||||
'menu_id' => 'belowheadermenu-ul',
|
||||
'container' => 'div',
|
||||
'container_id' => 'belowheadermenu',
|
||||
'depth' => 3,
|
||||
);
|
||||
}
|
||||
wp_nav_menu( $array );
|
||||
?>
|
||||
<div class="clear"></div>
|
||||
</nav>
|
||||
|
Loading…
Reference in New Issue
Block a user