lundi 15 décembre 2014

Custom field IF statement


This code is part of my custom post type template. I am using this statement to check if a custom field tempindi exists in the custom post type.


It seems that the first line doesn't work - it should return TRUE if the custom field exists. Any ideas?



<?php $ashurl = get_post_meta($post->ID, 'tempindi', true); if($ashurl) { ?>
<div class="main-content-full">
<?php } else { ?>
<div class="main-content<?php if($reviewSidebarEnabled) { ?>-left<?php } else { ?> full-width<?php } ?>">
<?php }?>




Aucun commentaire:

Enregistrer un commentaire