<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  <?php //the_post_thumbnail( 'sparkling-featured', array( 'class' => 'single-featured' )); ?>
	<div class="post-inner-content">
		<div class="container">
			<section class="custom-product-container custom-category-list">

				<div class="page-left my-new-left">
					<h3>News Release</h3>
					<h6>view by category</h6>
					<?php 
						echo do_shortcode ('[wpb_category_accordion taxonomy="news-type" orderby="id" order="ASC" show_count="no" hide_empty="no"]');
					 ?>
					<div style="height: 50px; clear:both;"></div>
				</div>

				<div class="right-content">
					<h1 class="my-page-title">
						<span class="my-title">News Release</span>
						<span class="my-deco"></span>
					</h1>

					<?php
						$current_id = get_queried_object()->term_id;
						$new_list='';
						 $args = array(
						        'post_type' => 'news',
						        'orderby' => 'date',
								'tax_query' => array(
								      array(
								      'taxonomy' => 'news-type',
								      'field' => 'id',
								      'terms' => $current_id
								      )
								     )
						        );
						  
						$query = new WP_Query( $args ); 
						$new_list.='<ul class="my-new-list">';
						if ( $query->have_posts() ) :while ( $query->have_posts() ) : $query->the_post();

						    $myterms = get_the_terms( $post->ID, 'news-type' );
						    foreach ($myterms as $t) {
						      $new_cat=$t->name;
						      $my_news_date=get_the_date('d.n.Y', '<div class="my-news-date">', '</div>');
						      $new_list.='<li><div class="my-news-date">'.get_the_date('d.n.Y').'</div>';
						      $new_list.='<div class="my-news-cat '.$t->slug.'">'.$new_cat.'</div>';
						      $new_list.='<div class="my-news-title"><a href="'. get_permalink().'">'. get_the_title().'</a></div>';
						      $new_list.='</li>';
						    }
						endwhile;
						else:
							 $new_list.='<li>no news available!</li>';
						endif;
						$new_list.='</ul>';

						echo $new_list;
					?>


				</div>
			</section>
		</div>
	</div>
</article>