HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux box12.multicloud.host 4.18.0-553.52.1.el8_10.x86_64 #1 SMP Wed May 14 09:36:12 EDT 2025 x86_64
User: kashmira (1008)
PHP: 8.1.32
Disabled: NONE
Upload Files
File: /home/kashmira/public_html/razitahir.com/wp-content/themes/upress/template-parts/posts-grid.php
<div class="block-head">
	<h2><?php echo get_cat_name( $block_cat ) ?></h2>
</div>
<div class="block-body">
<?php
$args = array(
	'cat' => $block_cat,
	'posts_per_page' => 6
);
$posts_query = new WP_Query( $args );

// The Loop
if ( $posts_query->have_posts() ) {
	while ( $posts_query->have_posts() ) {
		$posts_query->the_post(); ?>
		<div class="block-post-grid">
			<div class="post-thumbnail mb-10">
				<a href="<?php the_permalink() ?>">

				<?php
					if ( has_post_thumbnail() ) {
						the_post_thumbnail('postblock-grid');
					}
					else {
						echo '<img src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/nothumb.png" />';
					}
				?>

				</a>
			</div>
			<div class="post-title mt-5 mb-10">
				<h5>
					<a href="<?php the_permalink() ?>">
						<?php
							$trimtitle = get_the_title(); 
							$shorttitle = wp_trim_words( $trimtitle, $num_words = 12, $more = '… ' ); 
							echo $shorttitle;
						?>					
					</a>
				</h5>
			</div>
		</div>
	<?php }
} else {
	// no posts found
}
/* Restore original Post Data */
wp_reset_postdata();

?>
</div>