例子:如何通過Wordpress中的父頁面標題獲取頁面的所有子頁面?
About
--- technical
--- medical
--- historical
--- geographical
--- political
如何創建這樣的功能?
function get_child_pages_by_parent_title($title)
{
// the code goes here
}
並且調用它就像這樣會返回一個充滿對象的數組。
$children = get_child_pages_by_parent_title('About');
感謝您使用此快速代碼。是的,我同意你的ID更穩定。作爲可選的第二個參數,您能否實現返回頁面的限制? – 2012-02-08 14:32:57
固定(可以upvote這爲tnkx) – janw 2012-02-08 15:11:07