Je kunt het beste een betrouwbaar menu inbouwen.
Dat van Twenty Ten oid.
Je plaatst het script in de heder en de CSS plak je over je oude css.
Daarna maak je alles op maat
<!-- #access -->
<div id="access" role="navigation">
<?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
<div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
<?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>
<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
</div>
<!-- #access -->
en dit is de CSS daarvoor.
/* =Menu
-------------------------------------------------------------- */
#access .menu {font-family: Verdana;margin-top:0px;
}
#access div .menu ul {font-family: Verdana;margin-left: 0px;
}
#access {
background: #ccc;z-index:-1;
display: inline;
float: right;
width: 100%;
margin-top:0px;
height:21px;
}
#access .menu-header,
div.menu {
display: block;
font-size: 14px;
width: 100%;
background:#ccc;
list-style: none;
}
#access .menu-header ul,
div.menu ul {
list-style: none; margin-left: 300px;cursor:pointer;
}
#access .menu-header li,
div.menu li {
float: left;
position: relative;
}
#access a {
color: #000;
display: block;
line-height: 20px;
padding: 1px 14px 0px 14px;
text-decoration: none;
}
#access ul ul {
box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
-moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
-webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
position: absolute;
display: none;
margin-top: 0px;
margin-left:0px;
float: left;
width: 220px;
z-index: 99999;
}
#access ul ul li {
min-width: 220px;font-size:13px;
}
#access ul ul ul {
left: 100%;
top: 0;
}
#access ul ul a {
background: #ccc;
line-height: 20px;
padding-left: 10px;
height: auto;
border:1px solid black;
}
#access li:hover > a,
#access ul ul :hover > a {outline:none;
background: #ffffcc;
color: #000;
}
#access ul li:hover > ul {
display: block;
}
#access ul li.current_page_item > a,
#access ul li.current-menu-ancestor > a,
#access ul li.current-menu-item > a,
#access ul li.current-menu-parent > a {
color: #000;
}
* html #access ul li.current_page_item a,
* html #access ul li.current-menu-ancestor a,
* html #access ul li.current-menu-item a,
* html #access ul li.current-menu-parent a,
* html #access ul li a:hover {
color: #000;
}
Je hebt vast gelijk. De reden dat ik dat niet heb gedaan, is dat de html en css die ik nu heb,voor mij heel in- en overzichtelijk is,
Ik gebruik WP in dit geval niet waarvoor het bedoeld is, maar probeer het als cms in te zetten. Het loutere doel is om de ” klant ” de mogelijkheid te geven zelf aanpassingen te doen.
Daarbij stuit ik op problemen, zoals je gezien hebt.
Maar dank voor het meedenken!
Ik heb Robelia’s advies opgevolgd en het WordPress menu toegevoegd aan
http://www.spinsister.nl/WP/ .
De submenu’s (op het ogenblik heeft alleen ‘cursussen’ een submenu) waren echter te zien, dus ik heb toegevoegd:
li.menu-item ul li {display:none;}
Maar on hover moet het submenu natuurlijk wel verschijnen, maar dat lukt me niet. Ik heb geprobeerd het relevante deel van de wordpress 3 css over te nemen (#access vervangen door #menuwrapper), maar dat leverde niets op.
Waar ga ik fout?
Ook als ik niet mijn eigen theme gebruik, maar 2011 activeer, werkt het submenu bij cursussen niet. Is dat misschien een clue?
Het submenu werkt inmiddels. Ik had de display:block op li.menu-item ul li:a gezet in plaats van op li.menu-item:hover ul li.
Ik heb nu een ander probleem, maar dat gaat in een nieuwe post.