<?php if ('$post_id=591') : ?><?php if ($post_id == 591) : ?>$cat_id = 0;
switch ($post_id) {
    case 591:
        $cat_id = 30;
        break;
    case 852:
       $cat_id = 40;
        break;
    case 87:
        $cat_id = 43;
        break;
}
$pc = new WP_Query(array('cat' => $cat_id)) // и остальные Ваши параметры запроса
//Дальше сам циклadd_filter( 'wpcf7_validate_textarea', 'custom_textarea_validation_filter', 20, 2 );
add_filter( 'wpcf7_validate_textarea*', 'custom_textarea_validation_filter', 20, 2 );
 
function custom_textarea_validation_filter( $result, $tag ) {
    if ( 'your-message' == $tag->name ) {
        $your_message = isset( $_POST['your-message'] ) ? trim( $_POST['your-message'] ) : '';
 
        if ( strpos($your_message, 'http://') !== false ) {
            $result->invalidate( $tag, "Incorrect value" );
        }
    }
 
    return $result;
}function exclude_category( $query ) {
	if ( !is_admin() && $query->is_home() && $query->is_main_query() ) {
		$query->set( 'cat', '-5,-6' );
	}
}
add_action( 'pre_get_posts', 'exclude_category' );я пользуюсь customfieldsuite.com
<?php $fields = CFS()->find_fields( array( 'group_id' => 123 ) ); ?>array (
  0 => 'main',
  1 => 'active',
);<?php if( get_field('enable_sidebar') ): ?>
	
	<?php // do something ?>
	
<?php endif; ?><div class="promoheaderz">
  <div class='container'>
	<?php while ( have_rows('headerblock') ) : the_row(); ?>
      <div class="row" style="background-image: url(<?php echo get_sub_field('background_header')['url']; ?>);">
        <div class='discount_text dis col-md-4'>
          <?php the_sub_field('Text_left'); ?>
        </div>
        <div class='discount_img col-md-4'>
          <?php $img = get_sub_field('Product_image'); ?>
          <img src="<?php echo $img['url']; ?>" alt="<?php echo $img['alt']; ?>">
        </div>
        <div class='discount_text col-md-4 model'>
            <?php the_sub_field('Text_right'); ?>
        </div>
      </div>
	<?php endwhile; ?>
  </div>
</div>