Де купити?
_e('вернуться', 'text_service')?>
the_content();?>
$the_query = new WP_Query( array(
'post_type' => 'medicaments',
'posts_per_page' => -1,
'orderby' => 'post_title',
'order' => 'ASC',
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'geo_apteka',
'value' => '',
'compare' => '!='
),
array(
'key' => 'tabletki.ua',
'value' => '',
'compare' => '!='
)
)
));
$medicaments = $the_query->posts;
$arr_geo_apteka = array();
$arr_tabletki = array();
$arr_pharmacy = array();
foreach ($medicaments as $item) {
$geo_apteka = get_field('geo_apteka', $item->ID, true);
if($geo_apteka != '') $arr_pharmacy['pharmacy1'][] = $item;$tabletki = get_field('tabletki.ua', $item->ID, true);
if($tabletki != '') $arr_pharmacy['pharmacy2'][] = $item;
}if(!empty($arr_pharmacy)) {
foreach ( $arr_pharmacy as $key => $value ) {
?>
}
}
?>
-
foreach ( $value as $item ) {
$post_url = '';
if($key == 'pharmacy1') $post_url = get_field('geo_apteka', $item->ID, true);
if($key == 'pharmacy2') $post_url = get_field('tabletki.ua', $item->ID, true);
$class = '';
if(!empty($_GET['medicament']) && $_GET['medicament'] != '' && $_GET['medicament'] == $item->post_name) $class = 'active-medicament';
?>
- } ?>