Merhaba arkadaşlar,
Sidebar.php içinde hata alıyorum.
Warning: Invalid argument supplied for foreach() in /home/samsun/public_html/wp-content/themes/Temam/sidebar.php on line 27
foreach($childItems as $childItem){
if ($childItem->parent == $parentsItem->term_id){
$semt[$i][$j] = $childItem;
$j++;
};
};
$i++;
};
}
?>
27. sekme kodları bunlar, hatayı nerde aramalıyım ?
Sidebar Hatası Hk.
2
●245
- 17-06-2015, 15:50:07
- 17-06-2015, 17:43:38@KeremALTANSOY; 27. satırın birkaç satır üstünde bulunan betiği konuya ekleyebilir misiniz? Büyük bir ihtimalle $childItems değişkeni istenilen veriyi alamıyor. Yine de betiği görmemiz, sorunu anlamamız konusunda büyük bir yardımı olacağını düşünüyorum.
- 18-06-2015, 09:22:57<?php
$terms = get_terms('teslimat', 'orderby=count&hide_empty=0');
$count = count($terms);
if ( $count > 0 ){
foreach ( $terms as $term ) {
if (0 == $term->parent) $parentsItems[] = $term;
if ($term->parent) $childItems[] = $term;
}
$i=0;
foreach ($parentsItems as $parentsItem){
$ilce[$i] = $parentsItem;
//$semt[$i][0] = $parentsItem;
$j=0;
foreach ($childItems as $childItem) {
if ($childItem->parent == $parentsItem->term_id){
$semt[$i][$j] = $childItem;
$j++;
};
};
$i++;
};
}
?>