Nathan Rice @ get_depth()
- Author: Nathan Rice
- Sent: 2009-09-16 @ 2:25 e m
- Commented: get_depth()
One way to get the depth of a page is to use the get_post_ancestors() function.
< ?php
$ancestors = get_post_ancestors($post);
$depth = count($ancestors);
?>