Thao tác này sẽ tìm thấy ID của Trang mẹ nhiều nhất, trong một trang con lồng nhau. Ví dụ: trang bạn đang xem theo nghĩa đen được lồng vào
post_parent) ( $ancestors=get_post_ancestors($post->ID); $root=count($ancestors)-1; $parent = $ancestors($root); ) else ( $parent = $post->ID; ) ?>
$ cha sẽ là ID chính xác. Ví dụ: để sử dụng với wp_list_pages.
Nguồn: CSSGlobe