Hi! Erstmal Danke für deine Antwort.
So habe ich auch gedacht, mit einer if Abfrage, funktioniert aber nicht.
Ich glaube aber inzwischen, dass es nicht an der if Abfrage liegt sonder daran, dass ich meine frontpage bzw. homepage nicht ansprechen kann.
Denn es gibt hinter meiner Domain keinen slug etc. also es kommt lediglich http://www.domain.com/
Wenn ich auf Seite bearbeiten gehe dann sehe ich in der Adresszeile nocht das .../post=209&action=edit ... also dachte ich normal ist ja 209 die ID aber die spricht es auch nicht an. Inzwischen bin ich richtig verzweifelt.
Mit folgenden Codes hab ich es schon probiert:
Conditional Tag
function.php
[COLOR=#0000BB][FONT=monospace]<?php
[/FONT][/COLOR][COLOR=#FF8000][FONT=monospace]// Add a extra menus
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]register_nav_menus[/FONT][/COLOR][COLOR=#007700][FONT=monospace]( array(
[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'primary' [/FONT][/COLOR][COLOR=#007700][FONT=monospace]=> [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]__[/FONT][/COLOR][COLOR=#007700][FONT=monospace]( [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'Erstes Menü'[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'mytheme' [/FONT][/COLOR][COLOR=#007700][FONT=monospace]),
[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'secondary' [/FONT][/COLOR][COLOR=#007700][FONT=monospace]=> [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]__[/FONT][/COLOR][COLOR=#007700][FONT=monospace]( [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'Zweites Menü'[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'mytheme'[/FONT][/COLOR][COLOR=#007700][FONT=monospace])
) );
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>
[/FONT][/COLOR]header.php
[COLOR=#0000BB][FONT=monospace]<?php
[/FONT][/COLOR][COLOR=#007700][FONT=monospace]if ( [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]is_page[/FONT][/COLOR][COLOR=#007700][FONT=monospace](array( [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'Mypage1'[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'Mypage3'[/FONT][/COLOR][COLOR=#007700][FONT=monospace],[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'Mypage2' [/FONT][/COLOR][COLOR=#007700][FONT=monospace]) ) ) { [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>[/FONT][/COLOR]
[COLOR=#000000][FONT=monospace]<!-- Begin primary menu #menu1 -->[/FONT][/COLOR]
[COLOR=#000000][FONT=monospace]<div id="menu1" role="navigation">[/FONT][/COLOR]
[COLOR=#0000BB][FONT=monospace]<?php [/FONT][/COLOR][COLOR=#FF8000][FONT=monospace]// This is where the menu is added
[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]wp_nav_menu[/FONT][/COLOR][COLOR=#007700][FONT=monospace]( array([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'container_class' [/FONT][/COLOR][COLOR=#007700][FONT=monospace]=> [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'menu-top'[/FONT][/COLOR][COLOR=#007700][FONT=monospace],
[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'theme_location' [/FONT][/COLOR][COLOR=#007700][FONT=monospace]=> [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'primary'[/FONT][/COLOR][COLOR=#007700][FONT=monospace], [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'fallback_cb' [/FONT][/COLOR][COLOR=#007700][FONT=monospace]=> [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]''[/FONT][/COLOR][COLOR=#007700][FONT=monospace]) ); [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>[/FONT][/COLOR]
[COLOR=#000000][FONT=monospace]</div><!-- end of #menu1 -->[/FONT][/COLOR]
[COLOR=#0000BB][FONT=monospace]<?php [/FONT][/COLOR][COLOR=#007700][FONT=monospace]} [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>
[/FONT][/COLOR]Und dann habe ich noch die Möglichkeit über einen Filter versucht mit folgendem Code (ist aber nur ein Beispiel)
function change_wp_nav_menu_args($args = '')
{
$pageID = get_the_id();
if($pageID == '52') //custom menu for site with id 52
{
$args['menu'] = 'impressum-menu';
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'change_wp_nav_menu_args' );
Die page-id habe ich wieder mit 209 angegeben, bei $args['menu'] = habe ich mein in der functions.php angelegtes 2. Menü eingegeben.
Ging aber auch nicht. Vielleicht fällt dir oder auch anderen noch eine Idee ein.