我需要在我的主题中显示我的AFC字段。我的主题所有者告诉我,你应该编辑单间type.php文件。但是我找不到我应该在这个文件的什么地方添加我的ACF代码。我想我必须编辑另一个文件。你知道该怎么做吗?
<section class="content-editor">
<?php
while ( have_posts() ) : the_post();
if ( post_password_required() ) {
echo get_the_password_form();
return;
}
?>
<?php do_action( 'mphb_render_single_room_type_before_content' ); ?>
<?php
/**
* @hooked \MPHB\Views\SingleRoomTypeView::renderTitle - 10
* @hooked \MPHB\Views\SingleRoomTypeView::renderFeaturedImage - 20
* @hooked \MPHB\Views\SingleRoomTypeView::renderDescription - 30
* @hooked \MPHB\Views\SingleRoomTypeView::renderPrice - 40
* @hooked \MPHB\Views\SingleRoomTypeView::renderAttributes - 50
* @hooked \MPHB\Views\SingleRoomTypeView::renderCalendar - 60
* @hooked \MPHB\Views\SingleRoomTypeView::renderReservationForm - 70
*/
//do_action( 'mphb_render_single_room_type_content' );
?>
<?php the_content(); ?>
<?php do_action( 'mphb_render_single_room_type_after_content' ); ?>
<?php
endwhile;
?>
</section>发布于 2019-04-18 13:19:11
//-----------------------------------------------------
// Single Output
//-----------------------------------------------------
if(is_single()){ ?>
<section class="content-editor">
<?php while (have_posts()) : the_post(); ?>
<!-- Add your acf field here -->
<div class="your-acf-field"><?php echo get_field('your_acf_field',
get_the_ID());?></div>
<?php the_content(); ?>
<?php endwhile; ?>
</section>
<?php } else {https://stackoverflow.com/questions/55737878
复制相似问题