<?php
$category_id = $category_id ? $category_id : get_cat_id_by_slug(isset($slug) ? $slug : '');
$args = [
	'cat'            => $category_id,
	'posts_per_page' => $limit ? $limit : -1
];
$posts = get_posts($args);
?>
<div class="blog">
    <div class="row row-sm">
		<?php foreach ((array)$posts as $post) : ?>
            <div class="col-lg-4 mb-4">
				<?php get_template_part('part/item'); ?>
            </div>
		<?php endforeach; ?>
    </div>
</div>