<?php global $mango_settings, $portfolio_settings, $post; $terms = get_the_terms($post->ID, 'portfolio-category'); $portfolio_tags = array(); if ($terms && !is_wp_error($terms)) { $term_slugs = ''; foreach ($terms as $term) { $term_slugs .= ' category-' . $term->term_id; $term_link = get_term_link($term); $portfolio_tags[] = "<a href='" . esc_url($term_link) . "'>" . $term->name . "</a>"; } } $images = mango_portfolio_img_src(get_the_ID()); ?> <div class="portfolio-item portfolio-simple <?php echo esc_attr($term_slugs); ?> "> <figure> <img src="<?php echo esc_url($images['img']); ?> " alt="<?php the_title(); ?> "> </figure> <div class="portfolio-meta"> <div class="portfolio-content">
$args = array('posts_per_page' => '-1', 'post_type' => 'portfolio', 'post__not_in' => array($post_id), 'post_status' => 'publish', 'tax_query' => array(array('taxonomy' => 'portfolio-category', 'field' => 'slug', 'terms' => $tag_slug))); $related = new WP_Query($args); if ($related->have_posts()) { ?> <div class="row"> <div class="col-md-12 portfolio-related-container"> <h3><?php _e("Related Work", "mango"); ?> </h3> <div class="portfolio-related-carousel owl-carousel nav-animate popup-gallery"> <?php $portfolio_settings['page_style'] = "grid"; while ($related->have_posts()) { $related->the_post(); $images = mango_portfolio_img_src(get_the_ID(), "2col-portfolio"); ?> <div class="portfolio-item"> <figure> <a href="<?php echo esc_url($images['anchor']); ?> " class="zoom-item <?php echo esc_attr($images['class']); ?> " title="<?php the_title(); ?> "> <img src="<?php