correct bg menus
This commit is contained in:
@@ -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>
|
||||
";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ foreach ($categories as $category) {
|
||||
$bg_image = get_field('bg_image', 'category_' . $category->term_id);
|
||||
$category_link = get_category_link($category->term_id);
|
||||
?>
|
||||
<?php if ($icon) : ?>
|
||||
<a href="<?php echo esc_url($category_link); ?>" class="menu-link">
|
||||
<div class="menu-link__bg">
|
||||
<?php if ($bg_image) : ?>
|
||||
@@ -30,6 +31,7 @@ foreach ($categories as $category) {
|
||||
</div>
|
||||
<span class="menu-link__text"><?php echo esc_html($category->name); ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
@@ -19,7 +19,7 @@ if ($pinned_post) :
|
||||
<?php echo get_the_excerpt($pinned_post->ID); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="tag hero-banner__tag"><?php echo esc_html(get_category_name($pinned_post)); ?></div>
|
||||
|
||||
</a>
|
||||
|
||||
<?php endif; ?>
|
||||
Reference in New Issue
Block a user