我有以下内容,它成功地从引用的帖子中提取标题、缩略图和自定义字段数据(YouTube链接),但显示的内容是父级内容:
function woo_videos_tab_content() {
$posts = get_field(\'videos\');
if( $posts ): ?>
<div class="row">
<?php foreach( $posts as $p ): ?>
<div class="col-sm-4">
<?php
if ( has_post_thumbnail()) : ?>
<a data-remodal-target="modal-<?php echo $p->ID; ?>" class="video-link" title="<?php echo get_the_title( $p->ID ); ?>" >
<?php echo get_the_post_thumbnail( $p->ID, \'video-thumb\' ); ?>
<i class="fa fa-youtube-play fa-4x"></i>
</a>
<h4><?php echo get_the_title( $p->ID ); ?></h4>
// Issue with the line below
<?php echo get_the_content( $p->ID ); ?>
<div class="remodal" data-remodal-id="modal-<?php echo $p->ID; ?>">
<button data-remodal-action="close" class="remodal-close"></button>
<h2><?php echo get_the_title( $p->ID ); ?></h2>
<iframe src="<?php the_field(\'youtube_link\', $p->ID); ?>?enablejsapi=1&version=3" allowfullscreen="" width="560" height="315" frameborder="0" allowscriptaccess="always"></iframe>
</div>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<?php endif;
}
我应该通过另一种方法提取内容吗?我曾设想,标题/缩略图/自定义字段的工作方式将适用于内容。