BM
Size: a a a
BM
BM
BM
А
<?php
$cat = get_category( get_query_var( 'cat' ) );
$cat_id = $cat->cat_ID;
$child_categories=get_categories(
array( 'parent' => $cat_id )
);
?>
<?php
foreach ( $child_categories as $child ) {
// Here I'm showing as a list...
echo '<li>'.$child ->cat_name.'</li>';
}
?>
BM
А
<?php
$taxonomyName = "category";
$parent_terms = get_terms($taxonomyName, array('parent' => 0, 'orderby' => 'slug', 'hide_empty' => false));
foreach ($parent_terms as $pterm) {
echo '<div class="single_cat col-md-3">';
echo '<h3>'.$pterm->name.'</h3>';
$terms = get_terms($taxonomyName, array('parent' => $pterm->term_id, 'orderby' => 'slug', 'hide_empty' => false));
foreach ($terms as $term) {
echo "<ul>";
echo '<li><a href="' . get_term_link($term) . '">' . $term->name . '</a></li>';
echo "</ul>";
}
echo '</div>';
}
?>
BM
А
<a href="' . get_term_link($term) . '">' . $term->name . '</a>не получилось(
А
BM
С
BM
С
А
С
BM
BM
BM
С
BM