File: /var/www/vhosts/greenclinic.kz/newsite/wp-content/themes/green-clinic/page-doctors.php
<?php
$post_type = 'doctors';
$myposts = get_posts( [
'posts_per_page' => -1,
'post_type' => $post_type,
] );
?>
<?php get_header(); ?>
<?php get_template_part( 'template-parts/content_header', 'none' ); ?>
<section class="section doctor_section">
<div class="site-main container">
<div class="row doctor_row">
<?php foreach($myposts as $mypost ): ?>
<?php $doc_id = $mypost->ID;
$doc_name = get_field( 'name', $doc_id );
$doc_experience = get_field( 'experience', $doc_id );
$doc_speciality = get_field( 'speciality', $doc_id );
$doc_photo = get_field( 'photo', $doc_id );
$doc_int = get_field( 'International', $doc_id );
$doctor_show = get_field( 'doctor_show', $doc_id );
$btn_show = get_field( 'btn_show', $doc_id );
?>
<?php if($doc_int):?>
<?php else: ?>
<?php if($doctor_show): ?>
<?php else: ?>
<a href="<?php the_permalink($doc_id) ?>" >
<div class="doctors__card pointer">
<img src="<?php echo esc_html($doc_photo); ?>" alt="doctor">
<p class="doctors__card-name"><?php echo esc_html($doc_name); ?></p>
<p class="doctors__card-position"><?php echo esc_html($doc_speciality); ?></p>
<p class="doctors__card-exp"><?php
// Get the current language
$current_language = wpm_get_language();
// Output the appropriate translation based on the current language
if ($current_language == 'en') {
echo 'Experience';
} elseif ($current_language == 'kz') {
echo 'Еңбек өтілі';
} else {
echo 'Стаж'; // Default to Russian or the original language
}
?>: <?php echo esc_html($doc_experience); ?></p>
</div>
</a>
<?php endif;?>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
</section>
<?php get_template_part( 'blocks/blocks' ); ?>
<?php get_footer(); ?>