请帮忙!!收到以下错误。
它说'taxonomy-coupon-store.php 有问题,但找不到任何问题?
警告:在 /home/searche1/public_html/wp-content/themes/Deals/taxonomy-coupon_store.php 中为 foreach() 提供的参数无效
这是我的分类优惠券商店 php 文件:
ID, 'coupon_store' ); foreach ( $store_obj as $element ) { $store_id = $element->term_id; $store_name = $元素->名称;$store_description = $元素->描述;$store_count = $element->count; $store_url = get_term_link($element, 'coupon_store' ); } $store_url = get_metadata('coupon_store', $store_id, 'junkie_store_url', true); $store_aff_url = get_metadata('coupon_store', $store_id, 'junkie_store_aff_url', true); $store_image_preview = junkie_get_store_image_url($store_id, 'term_id', 100); ?><header class="page-heading clearfix">
<div class="entry-thumb-wrapper">
<a href="<?php echo $store_aff_url?$store_aff_url:$store_url; ?>" target="_blank"><img src="<?php echo $store_image_preview; ?>" class="store-thumbnail" alt="<?php the_title(); ?>" /></a>
</div><!-- .entry-thumb-wrapper -->
<div class="entry-excerpt">
<h1 class="entry-title"><?php echo $store_name; ?></h1>
<p class="store-url"><a href="<?php echo $store_aff_url?$store_aff_url:$store_url; ?>" target="_blank"><?php echo $store_url; ?></a></p>
<p class="store-desc"><?php echo $store_description; ?></p>
</div><!-- .entry-excerpt -->
</header><!-- .page-heading -->
<div class="content-heading clearfix">
<h3><?php _e('Active Coupons','junkie'); ?></h3>
</div><!-- .content-heading -->
<?php
if ( have_posts() ) :
while(have_posts()) : the_post();
get_template_part( 'content');
endwhile;
else :
get_template_part( 'coupon','none');
endif;
wp_reset_query();
?>
<?php
junkie_pagination();
?>
<div class="content-heading clearfix">
<h3><?php _e('Unreliable Coupons','junkie'); ?></h3>
</div><!-- .content-heading -->
<?php
$args=array(
'post_type'=>'coupon',
'posts_per_page' => 5,
'post_status' => 'expire',
'orderby' => 'DESC',
'meta_query' => array(
array(
'key' => 'expire_date',
'value' => current_time('mysql'),
'compare' => '<',
'type' => 'DATE'
)
),
'tax_query' => array(
array(
'taxonomy' => 'coupon_store',
'field' => 'slug',
'terms' => $term->slug
)
)
);
$recent = new WP_Query($args);
if ( $recent->have_posts() ) :
while($recent->have_posts()) : $recent->the_post();
get_template_part( 'content');
endwhile;
wp_reset_query();
else :
get_template_part( 'coupon', 'none' );
endif;
?>
</div><!-- #content -->
请帮忙!