<?php
function intro_tabs_shortcode() {
    ob_start(); // Start output buffering

	$args = array(
		'post_type' => array('page'),
		'posts_per_page' => 20,
		'page_category' => 'core-tabs',
		);
	?>																
	<?php $query = new WP_Query($args);?>
		<?php if ($query->have_posts()) : ?>
		<div class="row hover-back">
			<?php while ($query->have_posts()) :
				$query->the_post();
				$categories = get_the_category();
			?>
			<div class="col-md-3 kpy-all-news hover-effect" data-aos="fade-up">
				<article>
					<div class="mb-3 border-0">
					    <a class="icon" href="<?= esc_url(get_permalink()); ?>">	<?php the_excerpt(); ?>	</a>
						<a href="<?= esc_url(get_permalink()); ?>"><h3><?php the_title(); ?></h3></a>
						
					</div><!-- card !-->
				</article>
			</div><!-- col !-->
			<?php endwhile;
				wp_reset_postdata();
			else :
				echo 'No news found.';
			endif;
			?>
	</div><!-- Row !-->
    <?php

    return ob_get_clean(); // Return the buffered content
}

// Register the shortcode
add_shortcode('intro_tabs', 'intro_tabs_shortcode');

?>