Return to Snippet

Revision: 35197
at November 4, 2010 01:47 by awesomewordpressthemes


Initial Code
function hasChildpage() {
	$page = wp_list_pages('depth=1&child_of=' . $post->ID . '&echo=0');

	if($page) {
		return true;
	} else {
		return false;
	}
}

Initial URL
http://awesomewordpressthemes.net/wordpress-tips/check-current-page-subpage/

Initial Description
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

Initial Title
Check if current page has subpage

Initial Tags
wordpress

Initial Language
PHP