Hallo,
lass mir mit einem Php Script alle Subpages und SubSubpages etc. anzeigen,
mit Css möchte ich es so stylen das erst bei einem klick auf einen Menüpunkt
die Subpage sichtbar wird.
Das mit dem sichtbar werden klappt, jedoch klickt man jetzt auf eine Menüpunkt der aufgeklappten Subpage verschwindet dieser.
Was muss ich denn da im Css ändern?
neu.velokurierbiel.ch
HTML
#sidebar_left {
width: 200px;
position:relative;
margin-left:0px;
line-height: 1.5;
float:left;
margin-top:20px;
}
#sidebar_left li li a{
margin-left:0px;
font-size:10px;
}
#sidebar_left ul {
margin-top:0px;
margin-left:0px;
padding:0px;
padding-left:25px;
}
#sidebar_left li {
list-style:none;
}
#sidebar_left a {
color:black;
}
#sidebar_left a:hover {
color:gray;
}
#sidebar_left ul li li {
display:none;
}
#sidebar_left .current_page_item li{
display:block;
}
#sidebar_left .current_page_parent ul a {
color:black;
font-weight:normal;
}
#sidebar_left .current_page_item .children a{
font-weight:normal;
}
#sidebar_left .current_page_ancestor a{
font-weight:bold;
}
#sidebar_left .current_page_item a{
font-weight:bold;
}
#sidebar_left ul li .current_page_item a{
font-weight:bold;
display:block;
}
Alles anzeigen
PHP
<div id="sidebar_left">
<ul>
<?php /* Menu for subpages of current page */
global $notfound;
if (is_page() and ($notfound != '1')) {
$current_page = $post->ID;
while($current_page) {
$page_query = $wpdb->get_row("SELECT ID, post_title, post_status, post_parent FROM $wpdb->posts WHERE ID = '$current_page'");
$current_page = $page_query->post_parent;
}
$parent_id = $page_query->ID;
$parent_title = $page_query->post_title;
if ($wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = '$parent_id' AND post_type != 'attachment'")) {
?>
<?php wp_list_pages('sort_column=menu_order&title_li=&child_of='. $parent_id); ?>
<?php } } ?>
</ul>
</div>
Alles anzeigen