function getWidgets($position = null) {
if (empty($this->widgets)) {
foreach (wp_get_sidebars_widgets() as $pos => $ids) {
$this->widgets[$pos] = array();
foreach ($ids as $id) { // error is here
$this->widgets[$pos][$id] = $this->getWidget($id);
}
}
}
}
這些是305-314行。使用wordpress時的foreach()錯誤wp_get_sidebars_widgets()
我得到這個錯誤:
" Warning: Invalid argument supplied for foreach() in /home/content/73/9889573/html/wp-content/themes/yoo_spark_wp/warp/systems/wordpress.3.0/helpers/system.php on line 310 "
誰能告訴我怎麼解決呢
你的行號是有點偏離,因爲線310是'$這 - >小窗口[$ POS] [$ ID] = $這 - > getWidget($ ID); '但錯誤指的是foreach循環中的參數。 –
我的回答對你有幫助嗎? –