show custom post type with taxonomoy in template file in wordpress

<div class="caamera_loop">	
				<?php $categories = get_categories("taxonomy=cameracat");
				foreach ($categories as $category) :
				?>
				<div class="caamera_single">
					
					<div class="caamera_single_head">
						<?php echo $category->name;?>
					</div>

					<div class="caamera_single_li">
						<ul class="services_ul" id="<?php echo $category->term_id;?>" >
					<?php
					$args = array(
						'post_type' => 'camera',
						'posts_per_page' => -1,
						'tax_query' => array(
							array(
								'taxonomy' => 'cameracat',
								'field' => 'slug',
								'terms' => $category->slug
							)
						)
					);
					query_posts( $args );

					// The Loop
					$i=0;
					while ( have_posts() ) : the_post(); ?>	
							<li class="single-camera">
							<div class="single-camera-pic">
								<?php
									if ( has_post_thumbnail() ) {
										the_post_thumbnail();
									} 
								?>
							</div>	
							<a href="<?php echo the_permalink();?>">
							<?php the_title(); ?>
							</a>
							</li>
						<?php 
						$i++;
						endwhile;
							// Reset Query
							wp_reset_query();
						?>							
						</ul>
					</div>					
				</div>
				<?php endforeach; ?>
			</div>

show custom posts with category slug

<ul class="strategy_section" >
				<?php
				$args = array(
					'post_type' => 'strategy',
					'posts_per_page' => -1,
					//'cat_name' => $category->name,
					'tax_query' => array(
						array(
							'taxonomy' => 'service_cat',
							'field' => 'slug',
							'terms' => $category->slug
						)
					)
				);
				query_posts( $args );

				// The Loop
				$i=0;
				while ( have_posts() ) : the_post(); ?>	
						<li class="<?=$i>1?'hide_serv_li':''?>">
						<a href="<?php echo the_permalink();?>">
						<?php the_title(); ?>
						</a>
						</li>
					<?php 
					$i++;
					endwhile;
						// Reset Query
						wp_reset_query();
					?>							
					</ul>