Guest User

Untitled

a guest
Feb 22nd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?php
  2. $testArray = get_pages(array(
  3. 'child_of' => get_the_ID()
  4. ));
  5.  
  6. if ($theParent or $testArray) { ?>
  7. <div class="page-links">
  8. <h2 class="page-links__title"><a href="<?php echo get_permalink($theParent); ?>"><?php echo get_the_title($theParent); ?></a></h2>
  9. <ul class="min-list">
  10. <?php
  11. if ($theParent) {
  12. $findChildrenOf = $theParent;
  13. } else {
  14. $findChildrenOf = get_the_ID();
  15. }
  16.  
  17. wp_list_pages(array(
  18. 'title_li' => NULL,
  19. 'child_of' => $findChildrenOf,
  20. 'sort_column' => 'menu_order'
  21. ));
  22. ?>
  23. </ul>
  24. </div>
  25. <?php } ?>
Add Comment
Please, Sign In to add comment