Advertisement
Guest User

Untitled

a guest
Oct 18th, 2011
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. <div class="sub_menu">
  2.  
  3. <?php
  4. IF ($post->post_parent <> "0"){
  5. ?>
  6. <?php $subn_pages = get_pages( array('sort_order' => 'DESC','sort_column' => 'menu_order','child_of' => $post->post_parent,'post_type' => 'page') ); ?>
  7. <?php foreach ($subn_pages as $subn_page) {
  8. IF ($subn_page->ID <> $post->ID){
  9. echo "<div class='sub_menu_item'><a href='".get_page_link($subn_page->ID)."' class='top_menu'>".$subn_page->post_title."</a></div>";
  10. }Else{
  11. echo "<div class='sub_menu_item_selected'><a href='".get_page_link($subn_page->ID)."' class='top_menu'>".$subn_page->post_title."</a></div>";
  12. }
  13. }
  14.  
  15. }else{
  16. ?>
  17. <?php $sub_pages = get_children( array('sort_order' => 'DESC','sort_column' => 'menu_order','post_parent' => get_the_ID(),'post_type' => 'page') ); ?>
  18. <?php foreach ($sub_pages as $sub_page) {
  19. echo "<div class='sub_menu_item'><a href='".get_page_link($sub_page->ID)."' class='top_menu'>".$sub_page->post_title."</a></div>";
  20. }
  21. }
  22. ?>
  23.  
  24.  
  25.  
  26.  
  27. </div>
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement