if ($oct_blog_category_id == 1) {
$data['ne_pokazivat'] = false;
}
<?php if ($ne_pokazivat) { ?>
<p><?php echo $article['description']; ?></p>
<?php } ?>
function listing_category() {
global $listingpro_options;
$listing_cat_slug = '';
if(class_exists('ReduxFramework')){
$listing_cat_slug = $listingpro_options['listing_cat_slug'];
}
if(empty($listing_cat_slug)){
$listing_cat_slug = 'listing-category';
}
register_taxonomy(
'listing-category',
'listing',
array(
'labels' => array(
'name' => 'Categories',
'add_new_item' => 'Add New Category',
'new_item_name' => "New Category"
),
'show_ui' => true,
'show_tagcloud' => false,
'hierarchical' => true,
'rewrite' => array( 'slug' => $listing_cat_slug ),
'query_var' => true,
'public' => true,
'show_in_rest' => true,
'capabilities' => array(
'assign_terms' => 'assign_listing-category',
)
)
);
}
add_action( 'init', 'listing_category', 0 );
$locations = get_terms( 'listing-category',$args);
foreach($locations as $location) {
$cat_parent_link = get_category_link($location->term_id);
echo '<a href="'.$cat_parent_link.'" title="'.$location->name.'"><h3 id="'.$location->term_id.'">'.$location->name.'</h3></a>';
$sub = get_term_children( $location->term_id, 'listing-category' );
foreach ( $sub as $subID ) {
$term = get_term_by( 'id', $subID, 'listing-category' );
$cat_child_link = get_category_link($term->term_id);
echo '<a class="sub_cat" id="'.$term->term_id.'" href="'.$cat_child_link.'">'.$term->name.'</a>';
<?php
$args = array(
'post_type' => 'listing',
'order' => 'ASC',
'hide_empty' => false,
'parent' => 0,
);
$locations = get_terms( 'listing-category',$args);
foreach($locations as $location) {
echo '<h3 id="'.$location->term_id.'">'.$location->name.'</h3>';
$sub = get_term_children( $location->term_id, 'listing-category' );
foreach ( $sub as $subID ) {
$term = get_term_by( 'id', $subID, 'listing-category' );
echo '<span class="sub_cat" id="'.$term->term_id.'">'.$term->name.'</span>';
}
}
?>
<?php foreach ($product['option'] as $option) { ?>
<small> - <?php if ($option['name'] != 'Выберите размер') { ?>
<span><?php echo $option['name']; ?></span>
<?php } else { ?>
<span>Размер</span>
<?php } ?>: <?php echo $option['value']; ?></small><br />
<?php } ?>