<div class="kanren">
	<?php
	$categories = get_the_category( $post->ID );
	$category_ID = array();
	foreach ( $categories as $category ):
		array_push( $category_ID, $category->cat_ID );
	endforeach;
	$args = array(
		'post__not_in' => array( $post->ID ),
		'posts_per_page' => 5,
		'category__in' => $category_ID,
		'orderby' => 'rand',
	);
	if(trim($GLOBALS['stdata216']) !== ''):
		$st_infeed = $GLOBALS['stdata216'];
	else:
		$st_infeed = '';
	endif;
	$st_infeed_count = 1;
	$st_query = new WP_Query( $args ); ?>
	<?php
	if ( $st_query->have_posts() ): ?>
		<?php
		while ( $st_query->have_posts() ) : $st_query->the_post(); ?>
			<?php //インフィード広告
			if( (!amp_is_amp()) && (is_active_sidebar( 26 ) && (trim($st_infeed) !== '')) && ($st_infeed_count % $st_infeed === 0) ){ ?>
				<div class="st-infeed-adunit">
					<?php if ( function_exists( 'dynamic_sidebar' ) && dynamic_sidebar( 26 ) ) : else : ?>
					<?php endif; ?>
				</div>
			<?php
			}
			$st_infeed_count ++;
			?>
		<div class="no-thumbitiran">
			<?php get_template_part( 'st-single-category' ); //カテゴリー ?>
			<h5 class="kanren-t"><a href="<?php the_permalink(); ?>">
			<?php the_title(); ?>
			</a></h5>

			<?php get_template_part( 'st-excerpt' ); //抜粋 ?>

		</div>

		<?php endwhile; ?>
	<?php else: ?>
		<p>関連記事はありませんでした</p>
	<?php endif; ?>
	<?php wp_reset_postdata(); ?>
</div>