<div class="col-lg-4 col-md-6 mt-3">
    <div class="card rounded-0 overflow-hidden bg-light shadow faculty_department ">
        <div class="department-image">
            <?php if (has_post_thumbnail($post->ID)) :
                $imageInfo = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail');
                $imageUrl = $imageInfo[0]; ?>

                <img src="<?php echo $imageUrl ?>" class="h-100 w-100 object-cover" alt="...">
            <?php
            else:
                ?>
                <img src="<?php echo get_site_url(); ?>/wp-content/uploads/2024/07/2023052502551c6a8ee2-slider-security-1024x541-1.jpg"
                     class="h-100 w-100 object-cover" alt="...">
            <?php
            endif;
            ?>

        </div>
        <div class="card-body faculty_department_text" style="height: 200px;">
            <a href="<?php the_permalink(); ?>">
                <h3 class="card-title  fs-5 text-center fw-bolder overflow-hidden" style="height:48px;">
                    <?php the_title(); ?>
                </h3>
            </a>
            <?php
            /**
             * Custom Excerpt Length WordPress using wp_trim_excerpt()
             * Use directly in template
             */
            $excerpt = get_the_excerpt();
            echo ' <p>' . wp_trim_words($excerpt, '20') . '</p>';
            ?>
        </div>
    </div>
</div>