how to fix this coupon_store error in wordpress -


warning: invalid argument supplied foreach() in /home/content/52/11847652/html/coupons/wp-content/themes/deals/taxonomy-coupon_store.php on line 9

this url page giving error.

<?php $taxonomy='coupon_store'; $term = get_queried_object(); //get store. $store_obj = get_the_terms( $post->id, 'coupon_store' ); foreach ( $store_obj $element ) {     $store_id = $element->term_id;     $store_name = $element->name;     $store_description = $element->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); ?> 

 <?php      $taxonomy='coupon_store';      $term = get_queried_object(); //get store.      $store_obj = get_the_terms( $post->id, 'coupon_store' );     if(!empty($store_obj))      {      foreach ( $store_obj $element )       {        $store_id = $element->term_id;        $store_name =  $element->name;        $store_description = $element->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);  

?>


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -