0
워드 페스 커뮤니티보다 나은 응답 속도 때문에 여기에서 구하십시오.사용자 정의 게시물 유형 UI에 고급 사용자 정의 필드가 표시되지 않습니다.
Training Services라는 맞춤형 게시 유형을 설정했습니다. content_snippet이라는 사용자 정의 필드를 작성하고 관련 게시물 유형에만 적용되도록 지정했습니다. 게시물 유형 편집 화면에서 필드를보고 일부 lorem ipsum을 입력하십시오.
내 구현 코드는 다음과 같습니다 (content-page.php) : 게시물 유형의 제목, 콘텐츠 및 미리보기 이미지가 프런트 엔드에는 표시되지만 사용자 정의 필드에는 표시되지 않는 이유는 무엇입니까? 크롬 개발자가 볼 때 lorem이 있어야하는 빈 태그를 보여줍니다.
미리 도움을 청하십시오!
<!-- Custom Fields
================================================== -->
<?php
$content_snippet = get_field('content_snippet');
?>
<section class="container-fluid section-spacing" style="border:1px solid black;">
<div class=" text-align-center row" style="border:1px solid green;">
<h1><?php the_title(); ?></h1>
<hr class="headingUnderline">
<div class="responsiveShrink" style="border:1px solid yellow;"><?php the_content() ; ?></div>
<?php $loop = new WP_Query(array('post_type' => 'training_services', 'orderby' => 'post_id', 'order' => 'ASC')); ?>
<?php while($loop->have_posts()) : $loop->the_post(); ?>
<div class="text-align-center col-xs-12 col-sm-6" style="border:1px solid red;">
<div class="postWrapper">
<div class="imageWrapper">
<?php
if (has_post_thumbnail()) {
the_post_thumbnail();
}
?>
</div>
<div class="postContentWrapper">
<h3><?php the_title(); ?></h3>
<div><?php echo $content_snippet; ?></div>
<div><?php the_content(); ?></div>
</div>
</div>
</div>
<?php endwhile; wp_reset_query(); ?>
</div>
</section>