<?php
$step_val = $_GET['step'];
$selector = array(
'meta_key' => '_wp_page_template',
'meta_value' => 'page-card.php',
"post_type" => "page",
"hierarchical" => 0,
"posts_per_page" => -1,
"meta_query" => array(
array(
"key" => "Ступени, кол-во",
"value" => $step_val,
),
),
"orderby" => array(
"meta_key" => "Brand",
"order" => "ASC"
)
);
$pages = new WP_Query($selector); ?>
<div class="step">
<?php
$ser_iniq = "";
foreach( $pages->posts as $page ) {
$series = get_post_meta($page->ID, "Бренд", true);
if ($ser_uniq != $series) {
echo "</div>";
?>
<div class="main-h2">
<?php echo '<a href="https://tralia-lia-lia.com/esam-flux-jet/?brand=' . get_post_meta($page->ID, "бренд", true) . '">' ?>
<h2><?php echo $series ?> </h2>
</a>
<h3><?php echo get_post_meta($post->ID, "subtitle", true); ?></h3>
</div>
<?php
echo '<div class="step">';
$ser_uniq = $series;
}
?>
<div class="step-link-wrapper">
<a class="link-from-card" href=<?php echo "\"".get_permalink($page->ID)."\"";?>>
<figure class="wp-block-image">
</figure>
<div>
<h4><?php echo get_post_meta($page->ID, "0", true); ?> </h4>
<p><?php echo get_post_meta($page->ID, "1", true); ?> м<sup>3</sup>/ч, </p>
<p><?php echo get_post_meta($page->ID, "2", true); ?> мбар, </p>
<p><?php echo get_post_meta($page->ID, "3, true); ?> кВт </p>
</div>
</a>
</div>
<?php
}
?>
</div>