File: /var/www/vhosts/greenclinic.kz/newsite/wp-content/themes/green-clinic/single.php
<?php
/**
* The template for displaying all single posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package asds
*/
$categories = get_the_category( $the_post );
$categories_name = $categories[0]->name;
$categories_id = $categories[0]->term_id;
$categories_slug = $categories[0]->slug;
$the_post = get_the_ID();
get_header();
?>
<?php get_template_part( 'template-parts/content_header', 'none' ); ?>
<section class="section content_section">
<main id="primary" class="site-main container">
<?php
while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/content', get_post_type() );
/*
the_post_navigation(
array(
'prev_text' => '<span class="nav-subtitle">' . esc_html__( 'Previous:', 'asds' ) . '</span> <span class="nav-title">%title</span>',
'next_text' => '<span class="nav-subtitle">' . esc_html__( 'Next:', 'asds' ) . '</span> <span class="nav-title">%title</span>',
)
);
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
*/
endwhile; // End of the loop.
?>
<?php if($categories_slug == 'doctors'):?>
<?php $doc_name = get_field('name', $the_post); $meta_key = custom_acf_get_field_name_by_key( 'field_65acd802eff15' ); var_dump($doc_name);?>
<?php else: ?>
<?php endif;?>
</main><!-- #main -->
</section>
<?php get_template_part( 'blocks/blocks' ); ?>
<?php get_footer(); ?>