Remove a link from a page ID used within an array [closed]

I have updated your code please try this and let me know if any query

    <div class="row">        
        <?php
            $pages = array(54,55,56,57,58,74,75,76,77,78);     
            $i = 1;
            foreach ($pages as $page) 
            {
                $post_data = get_post( $page );
                //print_r($post_data);
                $title = $post_data->post_title;
                $content = $post_data->post_content;
                $string = substr($content, 0, 0);
                $themeta = get_post_meta($page,true);
                $metalink = $themeta[0];

                if (has_post_thumbnail($page) ):
                $image = wp_get_attachment_image_src( get_post_thumbnail_id($page), 'single-post-thumbnail' );
                endif;
                $image_URI = $image[0];?>
                <div class="product_pack">                  
                    <div class="product_cat">
<?php if( $page == 54 || $page == 75){}else{ ?>
                        <a href="https://wordpress.stackexchange.com/questions/315214/<?php echo get_permalink( $page ); ?>">
<?php }?>
                            <div class="product_img">
                                <img src="<?php echo $image_URI; ?>" alt="<?php echo $title; ?>"/>
                              <!--  <div class="produc_img-hover"><img src="<?php bloginfo('template_directory');?>/images/prd-star.png" alt="prd-star" /></div>    -->                                         
                            </div>
                            <div class="product_ttl"><?php echo $title; ?></div>
<?php if( $page == 54 || $page == 75){}else{ ?>
                        </a>                   
<?php }?>                        
                    </div>
               </div>       
                <?php               
            }?>
    </div>