Get_post_meta to had image text
-
Hi, I try to had a text “promotion” on a product image. I have create a custom field “promo” in my post-type. When the get_post_meta find the promo custom field I want ti display a small div that will show text over my prodcut image.
Here the code I have but it not working, I’m learning php.
<div class="packageImage"> <?php $promo = get_post_meta(get_the_ID(), 'promo', true); ?> <?php if ($promo): ?> <div class="packagePromoItem">Promotion</div> <?php endif; ?> <a alt="" href="<?php echo get_post_meta(get_the_ID(), 'wpcf-fichier-pdf', true); ?>" target="_blank"><img class="packageImage2" alt="" title="" src="<?php echo get_post_meta(get_the_ID(), 'wpcf-featured-images', true); ?>"></a> </div>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get_post_meta to had image text’ is closed to new replies.