 
      
    WordPress
    0
    Вклад в тег
    
      
      
    
  
  
<?php 
$arg_cat = array(
	//'orderby'      => 'name',
	'order'        => 'ASC',
	'hide_empty'   => 1,
	'exclude'      => '',
	'include'      => '',
	'taxonomy'     => 'pricecat',
);
$categories = get_terms( $arg_cat );
// var_dump( $categories );
?>
	<article class="article-post">
		<div id="content_box" >
		<?php if( $categories ){foreach( $categories as $cat ){
				
			$arg_posts =  array(
				// 'orderby'      => 'name',
            'post_type' => 'price',
            'post_status' => 'publish',
		    'posts_per_page' => -1,
			'order'    => 'DESC',
			'tax_query' => array(
				array(
					'taxonomy' => 'pricecat',
					'field'    => 'slug',
					'terms'    => $cat->slug,
				)
				),
			);
			$query = new WP_Query($arg_posts);
	
			?>
			<?php if ($query->have_posts() ) ?>
				<h2><?php echo $cat->name; ?> </h2>
			<?php while ( $query->have_posts() ) : $query->the_post(); ?>
							<div class="main-page-post">
							<?php the_title(); ?>
							</div>
			<?php endwhile?>
			<?php		
				}
			}
			?>
		</div>
	</article>