• How do I create an “if” for the custom fields? For example, if my KEY ID is $example, how do I make it so that only content will only appear if the key $exampleis available.

    WordPress uses the

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <?php endwhile; else: ?>
        <?php endif; ?>

    I’ve also seen:

    <?php if(function_exists('the_ratings')) { the_ratings(); } ?>

    So can’t I make a

    <?php if(key_exists('$example')) {whatever i want here } ?>

Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Creating an “if exists” for custom field keys’ is closed to new replies.