Forum Replies Created

Viewing 1 replies (of 1 total)
  • Forum: Fixing WordPress
    In reply to: Need a PHP lesson

    been looking for similar solution.

    figured it out with the code in this comment.

    so, if you want to check if c2c custom field has any content and echo something based on that this code works for me:

    <?php
    $VARIABLE_ID=c2c_get_custom('CUSTOM_FIELD_NAME');
    if (!empty($VARIABLE_ID)) { echo " BLAHBLAHBLAH "; }
    ?>

    in your code replace:
    VARIABLE_ID with something descriptive (var, var1, var2 etc.)
    CUSTOM_FIELD_NAME with the c2c field name you are checking
    BLAHBLAHBLAH with your content

    if(!empty(...)) means “if the field is NOT empty”

    i’m no PHP guru, all credit to the google for finding that 2005 comment from Nathaniel.

    good luck.
    rak.

Viewing 1 replies (of 1 total)