<?php $listaLojas = alt_get_lojas();?>
<div class="lojas">
    <?php foreach ($listaLojas as $loja): ?>
        <a href="?loja=<?=alt_get_user_loja($loja->ID)->ID?>">
            <?php 
                $site_url = get_home_url();
                $site_url = str_replace(['http://', 'https://'], '', $site_url);
                $src_img = $loja->meta['alt_lojas_imagem'][0];
                $src_img = str_replace(['http://', 'https://'], '', $src_img);
                $relative_url = str_replace($site_url, '', $src_img);
            ?>
            <div class="loja">
                <img src="<?= $relative_url ?>" alt="img_loja">
                <div class="nome_loja">
                    <h2><?= $loja->post_title; ?></h2>
                </div>
            </div>
        </a>
    <?php endforeach; ?>
</div>
