
<?php
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}
?>
<div class="nbdl-featured-designers">
    <?php 
        foreach( $designers as $designer ): 
            $name           = $designer['artist_name'] != '' ? $designer['artist_name'] : $designer['first_name'] . ' ' . $designer['last_name'];
            $link_designer  = add_query_arg( array( 'id' => $designer['id'] ), getUrlPageNBD( 'designer' ) );
            $avatar_url     = $designer['gravatar'] ? $designer['gravatar'] : NBDESIGNER_ASSETS_URL . 'images/avatar.png';
    ?>
    <div class="nbdl-featured-designer">
        <div class="nbdl-designer-wrap">
            <div class="nbdl-designer-header"
            <?php if( $designer['artist_banner'] ): ?>
                style="background: url('<?php echo $designer['artist_banner']; ?>') no-repeat center; background-size: cover;"
            <?php endif; ?>
            ></div>
            <div class="nbdl-designer-content">
                <div class="nbdl-designer-name"><a href="<?php echo $link_designer; ?>"><?php echo $name; ?></a></div>
                <div><?php echo $designer['artist_facebook']; ?></div>
                <div><?php echo $designer['artist_twitter']; ?></div>
                <div><?php echo $designer['artist_instagram']; ?></div>
            </div>
            <div class="nbdl-designer-footer">
                <a href="<?php echo $link_designer; ?>" class="nbdl-designer-link"><?php esc_html_e( 'Visit gallery', 'web-to-print-online-designer' ); ?></a>
                <span class="nbdl-designer-avatar">
                    <img src="<?php echo $avatar_url; ?>" />
                </span>
            </div>
        </div>
    </div>
    <?php endforeach; ?>
</div>