mercredi 13 juin 2018

Php If statement, to return set values from CMB2

I'm having trouble trying to find an answer to create a simple If statment that will return the html code I set if the values are entered within the backend of the page.

for example;

I want to display this:

<a href="<?php echo get_post_meta( get_the_ID(), '_mo_youtube_link', true ); ?>" class="product-yuotube" target="_blank"><i class="fa fa-youtube-play" aria-hidden="true"></i> Watch Video</a> 

but ONLY if the feild is filled in within the back of wordpress. I dont really know what else to say but if you require some more information then id answer any questions.

Thanks

Aucun commentaire:

Enregistrer un commentaire