File "archive-products.php"
Full path: /home/xs854402/smcse.co.jp/public_html/wp-content/themes/Sumitomo-Mitsui/archive-products.php
File
size: 7.07 B (7.07 KB bytes)
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php get_header(); ?>
<main class="corporate">
<?php include('template/bottom-corporate-products.php'); ?>
<?php include('template/breadcrumb.php'); ?>
<section class="p-products">
<div class="p-products__heading">
<div class="p-products__inner l-inner">
<div class="p-products__categories">
<a href="<?php echo esc_url(home_url('/products/')); ?>#bridge" class="p-products__category">橋梁関連</a>
<a href="<?php echo esc_url(home_url('/products/')); ?>#coastal" class="p-products__category">沿岸関連</a>
</div>
<div id="bridge" class="p-products__bridge">
<p class="p-products__entitle c-entitle c-entitle--capitalize">bridge related technology</p>
<h2 class="p-products__title c-title">橋梁関連技術</h2>
<?php
$the_query = new WP_Query();
$param = array(
'paged' => $paged,
'post_type' => 'products',
'posts_per_page' => '-1',
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC',
'tax_query' => array(
array(
'taxonomy' => 'products-cat',
'field' => 'slug',
'terms' => 'bridge',
'operator' => 'IN'
),
)
);
?>
<?php $the_query->query($param);
if ($the_query->have_posts()) : ?>
<div class="p-products__items">
<?php while( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="p-products__item p-record">
<p class="p-record__theme"><?php the_title(); ?></p>
<div class="p-record__body">
<?php
if(have_rows('look')) :
while (have_rows('look')) : the_row(); ?>
<?php
$acf_row_image = get_sub_field('look-img');
$url = $acf_row_image['url'];
$alt = $acf_row_image['alt'];
if ($url) :
?>
<div class="p-record__img c-img">
<img src="<?php echo $url; ?>" alt="<?php echo $alt; ?>">
</div>
<?php endif; ?>
<div class="p-record__wrap">
<p class="p-record__title"><?php echo the_sub_field('look-title'); ?></p>
<p class="p-record__text"><?php echo the_sub_field('look-text'); ?></p>
<a href="<?php the_permalink(); ?>" class="p-record__link">詳細を見る</a>
</div>
<?php
endwhile;
endif;
?>
</div>
</div>
<?php endwhile; ?>
</div>
<?php endif;
wp_reset_postdata(); ?>
</div>
</div>
</div>
<div id="coastal" class="p-products__coastal">
<div class="p-products__inner l-inner">
<p class="p-products__entitle c-entitle c-entitle--capitalize">coastal related technology</p>
<h2 class="p-products__title c-title">沿岸関連技術</h2>
<?php
$the_query = new WP_Query();
$param = array(
'paged' => $paged,
'post_type' => 'products',
'posts_per_page' => '-1',
'post_status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => 'products-cat',
'field' => 'slug',
'terms' => 'coastal',
'operator' => 'IN'
),
)
);
?>
<?php $the_query->query($param);
if ($the_query->have_posts()) : ?>
<div class="p-products__items">
<?php while( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="p-products__item p-record">
<p class="p-record__theme"><?php the_title(); ?></p>
<div class="p-record__body">
<?php
if(have_rows('look')) :
while (have_rows('look')) : the_row(); ?>
<?php
$acf_row_image = get_sub_field('look-img');
$url = $acf_row_image['url'];
$alt = $acf_row_image['alt'];
if ($url) :
?>
<div class="p-record__img c-img">
<img src="<?php echo $url; ?>" alt="<?php echo $alt; ?>">
</div>
<?php endif; ?>
<div class="p-record__wrap">
<p class="p-record__title"><?php echo the_sub_field('look-title'); ?></p>
<p class="p-record__text"><?php echo the_sub_field('look-text'); ?></p>
<a href="<?php the_permalink(); ?>" class="p-record__link">詳細を見る</a>
</div>
<?php
endwhile;
endif;
?>
</div>
</div>
<?php endwhile; ?>
</div>
<?php endif;
wp_reset_postdata(); ?>
</div>
</div>
</section>
</main>
<?php get_footer();