Answer the question
In order to leave comments, you need to log in
How to get the id of a video attached to a post in wordpress?
There is a cycle that displays my posts, videos are attached to these posts through the admin panel. I need to get the id of the attached file for each video. single.php code:
<?php get_header();?>
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php the_title('<div class="title-block">', '</div>'); ?>
<div class="block-text">
<div>Автор: <?php the_author_meta('display_name'); ?></div>
<div>Добавлено: <?php the_time( get_option( 'date_format' ) ); ?></div>
</div>
<div class="block-text">
<div>Кол-во просмотров: <?php echo getPostViews(get_the_ID()); ?></div>
<div>Категория: <?php the_category( ', ' ); ?></div>
</div>
<?php setPostViews(get_the_ID()); ?>
<?php endwhile; ?>
<?php get_footer();?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question