<?php
global $post;
$post_id = $post->ID;
$actors = wp_get_post_terms($post_id, 'actor');
if (!empty($actors)) : ?>
    <div class="list-actors rt rt-margin">
        <div class="main rt-relative">
            <div class="title-asli rt">
                <h3 class="name right rt-18 rt-fff rt-bold">بازیگران</h3>
            </div>
            <?php foreach ($actors as $actor) :
                $profile = get_term_meta($actor->term_id, 'profile_actor', true);
                if (!empty($profile)) $profile = wp_get_attachment_image_url($profile, 'full');
                if (empty($profile)) $profile = THEME_TEMPLATE_URL . '/assets/front/img/actor.png'; ?>
                <a href="<?php echo get_term_link($actor->term_id, 'actor') ?>" title="<?php echo $actor->name; ?>" rel="tag" class="right rt-35px"><img src="<?php echo $profile; ?>" alt="<?php echo $actor->name; ?>" height="40" class="right rt-50px">
                    <div class="name right rt-13 rt-ddd"><?php echo $actor->name; ?></div>
                </a>
            <?php endforeach; ?>
        </div>
    </div>
<?php endif; ?>