/ Published in: PHP
You may want to create navigation where the children are displayed only when the parent page is the current page. Place the code in your functions.php file
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function hasChildpage() { $page = wp_list_pages('depth=1&child_of=' . $post->ID . '&echo=0'); if($page) { return true; } else { return false; } }
URL: http://awesomewordpressthemes.net/wordpress-tips/check-current-page-subpage/