card-doctor.php 1.6 KB
<?php
    $otdels = array();
    $cur_terms = get_the_terms( get_the_ID(), 'specializaciy' );
    if( is_array( $cur_terms ) )
        foreach( $cur_terms as $cur_term )
            $otdels[] = $cur_term->slug;
    unset($cur_terms);        
?>
<div class="card card-doctor rounded-5 overflow-hidden border-0 <?php echo (isset($args['class'])?$args['class']:''); ?>" data-slug="<?php echo implode(' ', $otdels); ?>">
    <div class="card-header p-0 border-0 position-relative">
        <div class="row text-center position-absolute bottom-0 m-auto w-100">
            <a class="btn btn-lg col-6 p-0 rounded-0 fw-500 text-white d-flex flex-column align-items-center justify-content-center" href="//mwidget.fenixmedica.ru/" _href="<?php echo get_permalink( get_page_by_path( 'backvoices' ) ); ?>" data-icon="pen" _data-bs-toggle="modal" _data-bs-target="#backvoicesModal">Записаться</a>
            <a class="btn btn-lg col-6 p-0 rounded-0 fw-500 text-white d-flex flex-column align-items-center justify-content-center" href="<?php echo get_permalink( get_page_by_path( 'feedback' ) ); ?>" data-icon="question">Задать вопрос</a>
        </div>
<?php
if (has_post_thumbnail())
    the_post_thumbnail('doctor-thumbnails', array('class'=>'card-img-top img-fluid', 'alt'=>get_the_title()));
?>                    
    </div>
    <div class="card-body text-center">
        <h5 class="card-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
        <div class="card-text text-black"><?php echo str_replace("\n", '<br/>', get_the_excerpt()); ?></div>
    </div>
</div>
<?php
    unset($otdels);
?>