File "taxonomy.php"
Full path: /home/xs854402/smcse.co.jp/public_html/wp-content/themes/Sumitomo-Mitsui/taxonomy.php
File
size: 4.59 B (4.59 KB bytes)
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php get_header('employment'); ?>
<main>
<?php include('template/bottom-blog.php'); ?>
<?php include('template/breadcrumb.php'); ?>
<section class="p-blog">
<div class="p-blog__posts p-blog__posts--taxonomy">
<div class="p-blog__inner l-inner">
<p class="p-blog__entitle c-entitle c-entitle--capitalize">post list</p>
<?php $queried = get_queried_object(); ?>
<h2 class="p-blog__title c-title"><?php echo $queried->name; ?></h2>
<div class="p-blog__container">
<div class="p-blog__contents">
<?php
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$the_query = new WP_Query();
$param = array(
'paged' => $paged,
'post_type' => 'blog',
'posts_per_page' => '10',
'post_status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => 'blog-cat',
'field' => 'slug',
'terms' => $queried->slug,
'operator' => 'IN'
),
)
);
$the_query->query($param);
if ($the_query->have_posts()) :
if(function_exists('wp_pagenavi')) {
wp_pagenavi(array('query'=>$the_query));
}
?>
<div class="p-blog__archivePosts">
<?php
while( $the_query->have_posts() ) : $the_query->the_post();
?>
<div class="p-blog__item p-item p-item--content">
<a href="<?php the_permalink(); ?>" class="p-item__img c-img">
<?php
if (has_post_thumbnail()) :
the_post_thumbnail('post-thumbnail', array('alt' => the_title_attribute('echo=0')));
else :
echo '<img src="'.get_template_directory_uri().'/images/common/noimage.jpg" alt="'.esc_html(get_the_title()).'">';
endif; ?>
</a>
<div class="p-item__body">
<div class="p-item__info">
<time class="p-item__time" datetime="<?php the_time('c'); ?>"><?php the_time( 'Y年m月d日' ); ?></time>
<?php
$terms = get_the_terms($post->ID, 'blog-cat');
if ( $terms ) {
echo '<div class="p-item__categories">';
foreach ( $terms as $term ) {
echo '<a href="'.esc_url(get_term_link($term)).'" class="p-item__category">'.$term->name.'</a>';
}
echo '</div>';
}
?>
</div>
<h3 class="p-item__title"><?php the_title(); ?></h3>
<p class="p-item__text"><?php remove_filter('the_excerpt', 'wpautop'); the_excerpt();?></p>
</div>
</div>
<?php
endwhile; ?>
</div>
<?php
if(function_exists('wp_pagenavi')) {
echo '<div class="pagenavi-bottom">';
wp_pagenavi(array('query'=>$the_query));
echo '</div>';
}
endif;
wp_reset_postdata();
?>
</div>
<div class="p-blog__sidebar">
<?php include('template/sidebar.php'); ?>
</div>
</div>
</div>
</div>
</section>
</main>
<?php get_footer('employment');