wordpress - Display a banner if custom field is true -
i got following code display banner on repro:
<div> <div id="publicidad-video"> <iframe frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="300" height="250" src="su publicidad"></iframe> <br> <div style="float: left; left: 180px; position: relative; top: -210px; z-index: 9999;"> <span class="jbtn" onmouseover="jquery(this).hide('fast');jquery('#asd1').show('slow')">cerrar</span> </div> <div id="asd1" style="display: none; float: left; position: relative; top: -65px; z-index: 9999;"> <span class="jbtn" onclick="jquery(this).parent().parent().remove();">cerrar</span> </div> </div> <?php $values = get_post_custom_values("video"); echo $values[0]; ?> </div>
i got custom field call video, need display ad banner if post got video, because if use ad banner appear in posts videos or not.
anybody please can tell me code need add?
regards
the code you're using generate array posts have custom value of video. if wanted check if current post has value in custom field 'video' use:
<?php if ( get_post_meta(get_the_id(), "video", true)) : ?> <!-- html here if post has video --> <?php endif; ?>
Comments
Post a Comment