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>

Leave a Reply