我这样设定的变量在我的网站:PHP错误get_terms
$args = array('parent' => 2818,'hide_empty' => false);
$best_of_cat_child_terms = get_terms($args); -> (functions.php:26)
$best_of_cat = $best_of_cat_child_terms;
的问题是,我也越来越这个PHP错误:
警告:
Invalid argument supplied for foreach()
地点:
wp-includes/class-wp-term-query.php:373
调用堆栈:
WP_Term_Query->get_terms()
wp-includes/class-wp-term-query.php:287
WP_Term_Query->query()
wp-includes/taxonomy.php:1217
get_terms()
wp-content/themes/theme-child/functions.php:26 (-> functions.php line 26 marked above)
难道我设置这个正确的方式?
什么WP版本? –
@cale_b版本4.6.1 – Alex