Problem Homepage and menu
-
Hi,
I have 2 problems with Polylang.
I made a website in French and English : (french in default)
– Homepage : when i click on english flag, the website doesn’t want to launch a english version …:(
– And the menu doesn’t switch…Help me if you have any solution.
the website : http://www.royal-green.fr
-
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>Nobody ?
Hello
Did you rename the “Navigation Label” with an english title for your french menu?
Does your theme is freely available?
Hi,
Yes for the french menu and the theme is not a free theme.
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.
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 π
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', ) ); } ?>Thanks for the code but never done…. the website is juste white… it’s tired !
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', ) ); ?>Ooooooo shittt !!! it’s perfect thks a lot !!!
The topic ‘Problem Homepage and menu’ is closed to new replies.