WordPress – Créer une Troisième Sidebar – Create a Third Navigation Menu
Rajouter une troisième sidebar Add a third sidebar header.php <header id="header-left" class="<?php echo esc_attr( $third_nav_class ); ?>"> <div class="container clearfix"> <div id="et-left-navigation"> <nav id="left-menu-nav"> <?php $menuClass = 'nav'; if ( 'on' == et_get_option( 'divi_disable_toptier' ) ) $menuClass .= ' et_disable_top_tier'; $thirdNav = ''; $thirdNav = wp_nav_menu( array( 'theme_location' => 'my-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => 'left-menu', 'echo' => false ) ); if ( '' == $thirdNav ) : ?> <ul id="left-menu" class="<?php echo esc_attr( $menuClass ); ?>"> <?php if ( 'on' == et_get_option( 'divi_home_link' ) ) { ?> <li <?php if ( is_home() ) echo( 'class="current_page_item"' ); ?>><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php esc_html_e( 'Home', 'Divi' ); ?></a></li> <?php }; ?> <?php show_page_menu( $menuClass, false, false ); ?> <?php show_categories_menu( $menuClass, false ); ?> </ul> <?php else : echo( $thirdNav ); endif; ?> </nav> </div> <!-- #et-left-navigation --> </div> <!-- .container --> </header> <!-- #header-left --> + un troisième menu Add a third menu functions.php /* register menu de gauche */ function register_my_menu() { register_nav_menu('my-menu', __( 'Menu de gauche' )); } add_action( 'init', 'register_my_menu' ); Problème de limitation du nombre de liens de menu Create a new file and name it php.ini (the name and the extension are very important). Open it with any text editor and paste the following lines max_input_vars = 9000 Finally, save the file and upload it to your wp-admin folder. Rajouter un widget dans une quatrième sidebar Add a widget in a custom sidebar functions.php /* sidebar connexion widget area */ function arphabet_widgets_init() { register_sidebar( array ( 'name' => __('Connexion Widget Area'), 'id' => 'primary-widget-area', 'before_widget' => '<div id="%1$s" class="widget-container %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) ); } add_action( 'widgets_init', 'arphabet_widgets_init'...
Read more
Commentaires récents