Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
conditional tag - show custom field only if has value?
#3
(2012-11-24, 00:19:03)shawn_a Wrote: true is only to evaluate booleans.

You need to use isset() or !isempty() dependnig on what you are checking for.

Hi Shawn -

thank you for the reply. Could you be so kind and have a look at this example:
__________________________________________
<?php if(isset($_GET['post']) && $blogSettings["customfieldname"] == 'Y') { ?> do stuff <?php } ?>
__________________________________________

How should I write it than?
Thank you!

AD


okoko: Thanks - it works like this:

<?php if (!empty($post->customfieldname)) { ?>
do stuff <?php } ?>
Reply


Messages In This Thread
RE: conditional tag - show custom field only if has value? - by ad2003 - 2012-11-24, 05:34:42



Users browsing this thread: 1 Guest(s)