2016-03-06 80 views

回答

2

這是不可能的,wordpress只是接受一個整數的所有功能,獲取類別的孩子。你必須分開得到他們的孩子:

$terms = array(); 
$taxonomy = 'category'; 
$parents = array(10, 3, 8); 
foreach ($parents as $parent) { 
    $terms = array_merge($terms, get_categories(array('child_of'=> $parent))); 
} 

foreach ($terms as $term) { 
    // your code here 
} 

希望它有幫助!