this is my single.php
file in template
<?php
get_header();
$post_id = $post->ID;
$category = get_the_category($post_id);
$current_cat_id = $category[0]->cat_ID;
$current_cat_name = $category[0]->name;
$category_slug = $category[0]->slug;
$urlDir = get_template_directory_uri();
while (have_posts()) : the_post();
$img = get_the_post_thumbnail_url($post_id);
$imgMiddle = get_field("middle_img");
$imgBig = get_field("big_img");
if (!$img) {
$img = $urlDir . '/images/no-image/min.svg';
}
if (!$imgMiddle) {
$imgMiddle = $urlDir . '/images/no-image/middle.svg';
}
if (!$imgBig) {
$imgBig = $urlDir . '/images/no-image/big.svg';
}
$title = get_the_title();
$post_author_id = get_the_author_meta('ID');
$display_name = get_the_author_meta('display_name');
$userAva = get_field('user_avatar', "user_" . $post_author_id);
if (!$userAva) {
$userAva = $urlDir . '/images/no-image/author-incognito.svg';
}
?>
<div class="main_wrapper with_aside">
<main id="post-<?php echo $post_id ?>" class="main post">
<h1 class="post_title"><?php echo $title ?></h1>
<div class="post_figure">
<picture class="post_picture">
<source media="(min-width: 991px)" srcset="<?php echo $imgBig ?>">
<source media="(min-width: 450px)" srcset="<?php echo $imgMiddle ?>">
<img class="post_img" src="<?php echo $img ?>" width="320" height="400" alt="<?php echo $title ?>">
</picture>
<div class="post_desc">
<time class="time" datetime="<?php the_time('c'); ?>"><?php _e("Опубликовано: ", "");
the_time('j F Y') ?></time>
</div>
</div>
<div class="post_box">
<div class="post_box__wrapper">
<div class="post_box__dignity">
<span>Начинающий</span>
</div>
</div>
</div>
<div class="post_country"><?php echo do_shortcode('[um_user user_id="1" meta_key="country"]'); ?></div>
<div class="post_user__avatar">
<img src="<?php echo do_shortcode('[um_user user_id="1" meta_key="user_avatar"]'); ?>" alt="Начинающий">
</div>
<div class="post_text container">
<div class="bl_ceo mb0"><?php the_content();?></div>
</div>
</main>
<?php if (is_active_sidebar('true_side')) : ?>
<aside class="aside">
<?php dynamic_sidebar('true_side'); ?>
</aside>
<?php endif; ?>
</div>
<?php endwhile;
get_footer();