correct bg menus

This commit is contained in:
argoexpert press
2025-02-04 00:19:35 +03:00
parent 19f12627a0
commit 06f2f95ae8
7 changed files with 75 additions and 77 deletions

View File

@@ -25,11 +25,14 @@ array_push($categories, $firstElement);
$icon = get_field('icon', 'category_' . $cat->term_id);
$bg_image = get_field('bg_image', 'category_' . $cat->term_id);
$class = in_array($cat->term_id, $current_term_ids) ? 'is-active' : '';
if($bg_image){
echo "<a href='" . get_category_link($cat->term_id) . "' class='menu-vertical__item " . $class . "'>
$class = in_array($cat->term_id, $current_term_ids) ? 'is-active' : '';
echo "<a href='" . get_category_link($cat->term_id) . "' class='menu-vertical__item " . $class . "'>
<span class='menu-vertical__item-icon'><img src='" . $icon . "' alt=''></span>
<span class='menu-vertical__item-text'>$cat->name</a></span>
</a>
";
}
}