🚀 Advanced Web Server Manager
Complete File Manager & Terminal - Standalone Version
By Sid Gifari | Gifari Industries
Current path:
/
/
home
/
users
/
2
/
fujibow
/
web
/
fujibow.co.jp
/
wp-prod
/
wp-content
/
themes
/
fujibow
✏️
Editing: single-works.php
<?php get_header(); ?> <main id="single" class="single works"> <?php if(have_posts()): ?> <?php while(have_posts()):the_post(); ?> <?php // ACF $works_name = get_field('works-name'); $works_gallery = get_field('works-gallery'); $works_area = get_field('works-area'); $works_structure = get_field('works-structure'); $works_buildings = get_field('works-buildings'); $works_floors = get_field('works-floors'); $works_units = get_field('works-units'); $works_completionDate = get_field('works-completionDate'); $works_addProperties = get_field('works-addProperties'); $works_comment = get_field('works-comment'); $works_commentImg = get_field('works-commentImg'); // ヘッダー,コンテンツ読み込み $page_header_args = [ 'image' => IMG_PATH.'/common/page-header-single.svg', 'caption' => $works_name, ]; $header_type = 'header-works'; // ページヘッダーレイアウト get_template_part('template-parts/page', $header_type, $page_header_args); ?> <div class="works__contents"> <div class="inner"> <div class="works__contents-grid"> <div class="works__gallery"> <figure id="works__gallery-select" class="works__gallery-select"> <?php if( $works_gallery ): ?> <img src="<?php echo esc_url( $works_gallery[0]['url'] ); ?>" alt="<?php echo esc_attr( $works_gallery[0]['alt'] ); ?>"> <?php else: ?> <img src="<?php echo esc_url( no_img_path('no-image.jpg') ); ?>" alt="" class="no-img"> <?php endif; ?> </figure> <div id="works__gallery-thumbs" class="works__gallery-thumbs"> <?php if( $works_gallery ): foreach($works_gallery as $works_gallery_img): ?> <figure class="works__gallery-thumb"> <img src="<?php echo esc_url( $works_gallery_img['url'] ); ?>" alt="<?php echo esc_attr( $works_gallery_img['alt'] ); ?>"> </figure> <?php endforeach; endif; ?> </div> </div> <div class="works__properties"> <?php // 基本情報 $works_properties = [ '地域' => $works_area, '構造' => $works_structure, '棟数' => $works_buildings, '階数' => $works_floors, '戸数' => $works_units, '竣工年月' => $works_completionDate, ]; foreach( $works_properties as $property_k => $property_v ): if( !empty($property_v) ): ?> <dl class="works__property"> <dt><?php echo esc_html($property_k); ?> :</dt> <dd><?php echo esc_html($property_v); ?></dd> </dl> <?php endif; endforeach; ?> <?php // 追加情報 if( $works_addProperties ): foreach( $works_addProperties as $works_addProperty ): ?> <dl class="works__property"> <dt><?php echo esc_html($works_addProperty['title']); ?> :</dt> <dd><?php echo esc_html($works_addProperty['text']); ?></dd> </dl> <?php endforeach; endif; ?> </div> </div> <?php if(!empty($works_comment)): ?> <div class="works__comment"> <span class="works__comment-en">Voice of staff</span> <h2 class="works__comment-title">代理人のコメント</h2> <div class="works__comment-txt"> <p><?php echo esc_html_br($works_comment); ?></p> <?php if($works_commentImg){ echo acf_imgTag_from_imageArr($works_commentImg, null, false, 'works__comment-img'); } ?> </div> </div> <?php endif; ?> </div> </div> <section class="works__sameArea"> <div class="inner"> <h2 class="works__sameArea-title">同じ地域の実績</h2> <?php $parent_term = get_term_by('name', '地域', 'works-search'); if( $parent_term ){ // 同一地域ターム $search_term = []; $works_searches = get_the_terms(get_the_ID(), 'works-search'); if($works_searches){ foreach( $works_searches as $works_search){ if( $parent_term->term_id == $works_search->parent ){ $search_term[] = $works_search->name; } } } $slider_args = array( 'get_posts-args' => array( 'posts_per_page' => 10, 'post_type' => 'works', 'tax_query' => array( array( 'taxonomy' => 'works-search', // タクソノミーのスラッグを指定 'field' => 'name', // タームのフィールドを指定(slug や ID など) 'terms' => $search_term, // タームのスラッグを指定 'operator' => 'IN', ), ), ), 'auto-scroll' => true, ); get_template_part('template-parts/works', 'slider', $slider_args); } ?> </div> </section> <?php endwhile; ?> <?php else: ?> <?php endif; ?> </main><!-- .site-main --> <?php get_footer(); ?>
💾 Save Changes
❌ Cancel