Commit c2c083a9 by rajshah

fixed: related portfolio/casestudy section card category fetch fixed

parent 95806d26
...@@ -45,9 +45,15 @@ ...@@ -45,9 +45,15 @@
</div> </div>
<ul class="list-unstyled d-flex"> <ul class="list-unstyled d-flex">
<?php <?php
$terms = get_terms('portfolio-category'); $portfolio_post = is_object($portfolio) ? $portfolio : get_post($portfolio);
$post_type = get_post_type($portfolio_post);
$taxonomy = ($post_type === 'case-study') ? 'case-study-category' : 'portfolio-category';
$terms = get_the_terms($portfolio_post, $taxonomy);
if ($terms && !is_wp_error($terms)) {
foreach ($terms as $term) { foreach ($terms as $term) {
echo '<li>#' . $term->name . '</li>'; echo '<li>#' . esc_html($term->name) . '</li>';
}
} }
?> ?>
</ul> </ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment