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' ),
|
'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
|
// Preview some of our options
|
||||||
/*
|
/*
|
||||||
if ( $wp_customize->is_preview() && ! is_admin() )
|
if ( $wp_customize->is_preview() && ! is_admin() )
|
||||||
|
34
header.php
34
header.php
@ -81,16 +81,30 @@
|
|||||||
<?php $walker = new Atticus_Finch_Menu_With_Description; ?>
|
<?php $walker = new Atticus_Finch_Menu_With_Description; ?>
|
||||||
|
|
||||||
<nav id="primary-menu">
|
<nav id="primary-menu">
|
||||||
<?php wp_nav_menu( array(
|
<?php
|
||||||
'theme_location' => 'primary-menu',
|
if ( get_theme_mod( 'atticus_finch_main_menu_desc' ) == 1 ) {
|
||||||
'fallback_cb' => '',
|
$array = array(
|
||||||
'menu_class' => 'sf-menu',
|
'theme_location' => 'primary-menu',
|
||||||
'menu_id' => 'belowheadermenu-ul',
|
'fallback_cb' => '',
|
||||||
'container' => 'div',
|
'menu_class' => 'sf-menu',
|
||||||
'container_id' => 'belowheadermenu',
|
'menu_id' => 'belowheadermenu-ul',
|
||||||
'depth' => 3,
|
'container' => 'div',
|
||||||
'walker' => $walker,
|
'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>
|
<div class="clear"></div>
|
||||||
</nav>
|
</nav>
|
||||||
|
Loading…
Reference in New Issue
Block a user