/ Published in: PHP

This is what I wanted:\r\nI had a structure like this:\r\n-Artist\r\n --Peter Miller\r\n ---Pictures\r\n ---Press\r\n ---Videos\r\n\r\nand wanted to have the sub-sub-Menu when located on the \"Peter Miller\"-Page. \r\nSo that on \"Peter Miller\" you\'d have \"Pictures, Press and Videos\"-Menu and also on the sibling pages but not on Artists-Page!
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php global $wp_query; { $parent = $wp_query->post->ID; } else { $parent = $wp_query->post->post_parent; } ?> <?php if(wp_list_pages("title_li=&child_of=$parent&echo=0" )): ?> <ul class="submenus"> <?php wp_list_pages("title_li=&child_of=$parent" ); ?> </ul> <?php endif; ?>
Comments
