Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Matlesgi

    (@matlesgi)

    in index.php for my theme i have :

    <div class=”nav “>
    <?php if ( has_nav_menu( ‘main_nav_menu’ ) ) { /* if menu location ‘Top Navigation Menu’ exists then use custom menu */ ?>
    <?php wp_nav_menu( array(‘menu’ => ‘Top Navigation Menu’, ‘menu_class’ => ‘sf-menu’)); ?>
    <?php } else { /* else use wp_list_pages */?>
    <ul class=”sf-menu”>
    <?php wp_list_pages( array(‘title_li’ => ”,’sort_column’ => ‘menu_order’)); ?>

    <?php } ?>
    </div>

    Thread Starter Matlesgi

    (@matlesgi)

    Nobody ?

    Plugin Support Chrystl

    (@chrystl)

    Hello

    Did you rename the “Navigation Label” with an english title for your french menu?

    Does your theme is freely available?

    Thread Starter Matlesgi

    (@matlesgi)

    Hi,

    Yes for the french menu and the theme is not a free theme.

    Plugin Support Chrystl

    (@chrystl)

    Yes for the french menu

    It’s not a good way. If you touch the page “Navigation Label” rename it in the right language of your menu.

    Thread Starter Matlesgi

    (@matlesgi)

    ok it’s good now but the menu doesn’t switch…
    I’m not understand how change my html for the menu finally function :
    <div class=”nav “>
    <?php if ( has_nav_menu( ‘main_nav_menu’ ) ) { /* if menu location ‘Top Navigation Menu’ exists then use custom menu */ ?>
    <?php wp_nav_menu( array(‘menu’ => ‘Top Navigation Menu’, ‘menu_class’ => ‘sf-menu’)); ?>
    <?php } else { /* else use wp_list_pages */?>
    <ul class=”sf-menu”>
    <?php wp_list_pages( array(‘title_li’ => ”,’sort_column’ => ‘menu_order’)); ?>

    <?php } ?>
    </div>

    If you have any ideas to corrige this @chrysti… thks πŸ™‚

    Plugin Support Chrystl

    (@chrystl)

    Replace this part :

    <?php if ( has_nav_menu( 'main_nav_menu' ) ) { /* if menu location 'Top Navigation Menu' exists then use custom menu */ ?>
    <?php wp_nav_menu( array('menu' => 'Top Navigation Menu', 'menu_class' => 'sf-menu')); ?>

    by

    <?php
    if ( has_nav_menu( 'main_nav_menu' ) ) {
         wp_nav_menu( array(
                      'theme_location'  => 'main_nav_menu',
                      'menu_class'      => 'sf-menu',
    
    ) );
    }
    ?>
    Thread Starter Matlesgi

    (@matlesgi)

    Thanks for the code but never done…. the website is juste white… it’s tired !

    Plugin Support Chrystl

    (@chrystl)

    Sorry I put a wrong }. Try this:

    <?php
    if ( has_nav_menu( 'main_nav_menu' ) ) {
         wp_nav_menu( array(
                      'theme_location'  => 'main_nav_menu',
                      'menu_class'      => 'sf-menu',
    
    ) );
    ?>
    Thread Starter Matlesgi

    (@matlesgi)

    Ooooooo shittt !!! it’s perfect thks a lot !!!

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Problem Homepage and menu’ is closed to new replies.